runway

Runway

DropdownText

A dropdown text component that can be used to display hidden content


Dropdown Text


The DropdownText component is a dropdown text component that can be used to display hidden content. It is a great way to organize and display information in a structured and visually appealing way.

Want to use multiple dropdowns? Check out the Accordion component.



Usage

javascript

1import DropdownText from '@/components/atoms/DropdownText';
2
3<DropdownText
4    title="Dropdown Text"
5    content="This is the content of the dropdown text component."
6/>

Use borderStyle to change the border style of the dropdown text component.




Props

The DropdownText component accepts the following props:

NameTypeDefaultDescription
titlestring-The title of the dropdown text component.
contentstring-The content of the dropdown text component.
isOpenbooleanfalseIf true, the dropdown text component is open.
onTogglefunction-A function that is called when the dropdown text component is toggled.
borderbooleantrueIf true, the dropdown text component has a border.
borderStyle"b" | "t" | "l" | "r""b"The border style of the dropdown text component (uses Tailwind border classes).
activeColorstring"primary"The base color (use tailwind.config).
classNamestring""Additional Tailwind utility classes.
...propsobject-Any other valid HTML attributes.

The component can either manage its own state or be controlled by the parent component using the isOpen and onToggle props.




Examples

Basic DropdownText

Dropdown Text


Controlled DropdownText

Dropdown Text

This is the content of the dropdown text component.


DropdownText with No Border

Dropdown Text


DropdownText with Custom Border Style

Dropdown Text


Full Border DropdownText

Dropdown Text