The source code for this library is available on GitHub.

Vaiva's Pattern Library.


TailwindCSS Text Carousel

The title speaks volumes.

Button

There is no description. Have a poem instead.

When I heard the learn’d astronomer,
When the proofs, the figures, were ranged in columns before me,
When I was shown the charts and diagrams, to add, divide, and measure them,
When I sitting heard the astronomer where he lectured with much applause in the lecture-room,
How soon unaccountable I became tired and sick,
Till rising and gliding out I wander’d off by myself,
In the mystical moist night-air, and from time to time,
Look’d up in perfect silence at the stars.

useClickOutside Hook

Clicking outside a referential element will close it. This hook is useful for dropdowns, modals, etc. To use it you must import useRef and create a variable named 'wrapperRef' with a value of 'useRef(null)'. You then attach 'ref={wrapperRef} to the element you'd like the user to click outside of. To close the element, create a 'closeInput' function sets state to the desired value.

useWindowSize Hook

Returns the size of the window. This hook can be used for rendering elements at varying screen widths. To use it you should create a variable that calls useWindowSize. The screen width can then be accessed using 'variableName.width'.

Call to Action

There is no description. Have a poem instead.

When I heard the learn’d astronomer,
When the proofs, the figures, were ranged in columns before me,
When I was shown the charts and diagrams, to add, divide, and measure them,
When I sitting heard the astronomer where he lectured with much applause in the lecture-room,
How soon unaccountable I became tired and sick,
Till rising and gliding out I wander’d off by myself,
In the mystical moist night-air, and from time to time,
Look’d up in perfect silence at the stars.

Modal

Modal that uses the useClickOutside hook to close upon clicking outside of it.

Text Carousel

Carousel that takes the TextCarouselItem component as a child to display swipeable text.

Image Carousel

Carousel that takes the ImageCarouselItem component as a child to display swipeable images. By default, the images automatically swipe every few seconds and are paused when the mouse hovers over them.

Accordion

Accordion that maps through an array (accordionList) of objects (ENTRIES: title, content) and returns an expandable accordion item.