Collapsible
Collapsible elements are used to show and hide content using a smooth reveal transition.
Basic Example
Collapsing an element will animate the height from zero to its default value. This component is useful for creating clearly separated content sections such as FAQ pages.
Item Header
You can use the header slot to provide a custom title for the collapsible panel’s heading.
Default Open Panels
Panels can be opened by default, on page load, using the v-model directive of the <i-collapsible> component. First, you’ll need to assign an id to the <i-collapsible-item> components which will identify the open panels.
Accordion
Accordion collapsible groups can have only one content panel open at a single time. This behaviour can be set using the accordion property.
Color Variants
Inkline includes basic predefined collapsible colors that you can use within your application. You can apply a style using the color property.
Size Variants
You’re able to use the size modifier to control the text and spacing size of your collapsible, using one of the available sizes: sm, md, and lg. The default size is set to md.
Configuration
Props
Use props to modify the component’s design and behavior.
- Property
accordionTypeBooleanDefaultfalseDescription Display the collapsible as an accordion, keeping a maximum of one open collapsible item - Property
colorType'light' | 'dark' | 'blank'Default'light'Description The color variant of the button - Property
sizeType'sm' | 'md' | 'lg'Default'md'Description The size variant of the collapsible - Property
modelValueTypeString[]Default''Description Used to determine which collapsible item is open
Slots
Use slots to insert custom content into well-defined component locations.
- Property
defaultDescription Slot for default collapsible content
Events
Use events to react to something happening inside the component.
- Property
update:modelValueDescription Event emitted for setting the modelValue
CSS Variables
Read more about configuring Inkline’s Design System variables to update the look and feel of the component.
- Property
----backgroundValuecolor('light')Description The background of the collapsible component - Property
----border-top-colorValuecolor('light-60')Description The border top color of the collapsible component - Property
----border-right-colorValuecolor('light-60')Description The border right color of the collapsible component - Property
----border-bottom-colorValuecolor('light-60')Description The border bottom color of the collapsible component - Property
----border-left-colorValuecolor('light-60')Description The border left color of the collapsible component - Property
----border-colorValuevar(----border-top-color) var(----border-right-color) var(----border-bottom-color) var(----border-left-color)Description The border color of the collapsible component - Property
----border-styleValuevar(--border-style)Description The border style of the collapsible component - Property
----border-top-widthValuevar(--border-top-width)Description The border top width of the collapsible component - Property
----border-right-widthValuevar(--border-right-width)Description The border right width of the collapsible component - Property
----border-bottom-widthValuevar(--border-bottom-width)Description The border bottom width of the collapsible component - Property
----border-left-widthValuevar(--border-left-width)Description The border left width of the collapsible component - Property
----border-widthValuevar(----border-top-width) var(----border-right-width) var(----border-bottom-width) var(----border-left-width)Description The border width of the collapsible component - Property
----border-top-left-radiusValuevar(--border-top-left-radius)Description The border top left radius of the collapsible component - Property
----border-top-right-radiusValuevar(--border-top-right-radius)Description The border top right radius of the collapsible component - Property
----border-bottom-right-radiusValuevar(--border-bottom-right-radius)Description The border bottom right radius of the collapsible component - Property
----border-bottom-left-radiusValuevar(--border-bottom-left-radius)Description The border bottom left radius of the collapsible component - Property
----border-radiusValuevar(----border-top-left-radius) var(----border-top-right-radius) var(----border-bottom-right-radius) var(----border-bottom-left-radius)Description The border radius of the collapsible component - Property
----box-shadow-offset-xValuevar(--box-shadow-offset-x)Description The box shadow horizontal offset of the collapsible component - Property
----box-shadow-offset-yValuevar(--box-shadow-offset-y)Description The box shadow vertical offset of the collapsible component - Property
----box-shadow-blur-radiusValuevar(--box-shadow-blur-radius)Description The box shadow blur radius of the collapsible component - Property
----box-shadow-spread-radiusValuevar(--box-shadow-spread-radius)Description The box shadow spread radius of the collapsible component - Property
----box-shadow-colorValuevar(--box-shadow-color)Description The box shadow spread radius of the collapsible component - Property
----box-shadowValuevar(----box-shadow-offset-x) var(----box-shadow-offset-y) var(----box-shadow-blur-radius) var(----box-shadow-spread-radius) var(----box-shadow-color)Description The box shadow of the collapsible component - Property
----colorValuecontrast-color($color-light)Description The color of the collapsible component - Property
----font-sizeValuefont-size()Description The font size of the collapsible component - Property
----padding-topValuevar(--padding-top)Description The padding top of the collapsible component - Property
----padding-rightValuevar(--padding-right)Description The padding right of the collapsible component - Property
----padding-bottomValuevar(--padding-bottom)Description The padding bottom of the collapsible component - Property
----padding-leftValuevar(--padding-left)Description The padding left of the collapsible component - Property
----paddingValuevar(----padding-top) var(----padding-right) var(----padding-bottom) var(----padding-left)Description The padding of the collapsible component - Property
----header--backgroundValuevar(----background)Description The background of the collapsible component header - Property
----header--border-colorValuevar(----border-color)Description The border color of the collapsible component header - Property
----header--border-styleValuevar(----border-style)Description The border style of the collapsible component header - Property
----header--border-top-widthValuevar(----border-top-width)Description The border top width of the collapsible component header - Property
----header--border-right-widthValuevar(----border-right-width)Description The border right width of the collapsible component header - Property
----header--border-bottom-widthValuevar(----border-bottom-width)Description The border bottom width of the collapsible component header - Property
----header--border-left-widthValuevar(----border-left-width)Description The border left width of the collapsible component header - Property
----header--border-widthValuevar(----header--border-top-width) var(----header--border-right-width) var(----header--border-bottom-width) var(----header--border-left-width)Description The border width of the collapsible component header - Property
----header--colorValuevar(----color)Description The color of the collapsible component header - Property
----header--padding-topValuevar(----padding-top)Description The padding top of the collapsible component header - Property
----header--padding-rightValuevar(----padding-right)Description The padding right of the collapsible component header - Property
----header--padding-bottomValuevar(----padding-bottom)Description The padding bottom of the collapsible component header - Property
----header--padding-leftValuevar(----padding-left)Description The padding left of the collapsible component header - Property
----header--paddingValuevar(----header--padding-top) var(----header--padding-right) var(----header--padding-bottom) var(----header--padding-left)Description The padding of the collapsible component header - Property
----body--backgroundValuecolor('white')Description The background of the collapsible component body - Property
----body--border-colorValuevar(----border-color)Description The border color of the collapsible component body - Property
----body--border-styleValuevar(----border-style)Description The border style of the collapsible component body - Property
----body--border-top-widthValue0Description The border top width of the collapsible component body - Property
----body--border-right-widthValuevar(----border-right-width)Description The border right width of the collapsible component body - Property
----body--border-bottom-widthValuevar(----border-bottom-width)Description The border bottom width of the collapsible component body - Property
----body--border-left-widthValuevar(----border-left-width)Description The border left width of the collapsible component body - Property
----body--border-widthValuevar(----body--border-top-width) var(----body--border-right-width) var(----body--border-bottom-width) var(----body--border-left-width)Description The border width of the collapsible component body - Property
----body--colorValuevar(----color)Description The color of the collapsible component body - Property
----body--padding-topValuevar(----padding-top)Description The padding top of the collapsible component body - Property
----body--padding-rightValuevar(----padding-right)Description The padding right of the collapsible component body - Property
----body--padding-bottomValuevar(----padding-bottom)Description The padding bottom of the collapsible component body - Property
----body--padding-leftValuevar(----padding-left)Description The padding left of the collapsible component body - Property
----body--paddingValuevar(----body--padding-top) var(----body--padding-right) var(----body--padding-bottom) var(----body--padding-left)Description The padding of the collapsible component body