# Accordion
**Also known as:** Expander
## Description
The Accordion shows and hides a section of content behind a header. The header is a button inside a heading, wired to its panel the way the WAI-ARIA accordion pattern asks; the panel animates to its content's height, can be found by find-in-page while closed, and the whole component is driven by binding, events or its Expand, Collapse and Toggle methods.
## Parameters
| Name | Type | Default Value | Description |
| :--- | :--- | :------------ | :---------- |
| Actions | `RenderFragment?` | null | The content rendered beside the header, outside of the toggle button and of the heading it sits in, so that it can hold its own interactive elements (a menu, a delete button, a switch). |
| Background | `BitColorKind?` | null | The color kind of the background of the accordion. An explicit value wins over --bit-Accordion-background and the two header shade variables, inherited or set on the instance; left unset, the accordion takes the primary background (the secondary one with NoBorder) unless they say otherwise. |
| Border | `BitColorKind?` | null | The color kind of the border of the accordion. An explicit value wins over --bit-Accordion-border-color, inherited or set on the instance; left unset, the outline takes the primary border color unless it says otherwise. |
| Body | `RenderFragment?` | null | Alias for the ChildContent parameter. |
| Busy | `bool` | false | Reports the header as busy - a spinner in the expander's slot, aria-busy and a busy cursor, and no click toggles it - while something the page is doing on the accordion's behalf is still running. An accordion whose own OnToggling is being awaited reports itself as busy without being told to. |
| Classes | `BitAccordionClassStyles?` | null | Custom CSS classes for different parts of the accordion. |
| ChildContent | `RenderFragment?` | null | The content of the accordion. |
| DefaultIsExpanded | `bool?` | null | Default value for the IsExpanded parameter. |
| Description | `string?` | null | A short description in the header of the accordion. |
| ExpandedExpanderIcon | `BitIconInfo?` | null | Gets or sets the icon to show in place of the expander icon while the accordion is expanded, using custom CSS classes for external icon libraries. Takes precedence over ExpandedExpanderIconName when both are set. Setting either of them also turns the rotation of the expander icon off. |
| ExpandedExpanderIconName | `string?` | null | Gets or sets the name of the icon, from the built-in Fluent UI icons, to show in place of the expander icon while the accordion is expanded. Setting it also turns the rotation of the expander icon off. |
| ExpanderIcon | `BitIconInfo?` | null | Gets or sets the icon to display as expander using custom CSS classes for external icon libraries. Takes precedence over ExpanderIconName when both are set. Defaults to the ChevronRight icon if neither property is set. |
| ExpanderIconName | `string?` | null | Gets or sets the name of the icon to display as expander from the built-in Fluent UI icons. Defaults to ChevronRight if not set. |
| ExpanderIconPlacement | `BitPlacement?` | null | Gets or sets the side of the header the expander icon sits on. The default value is End. Only Start and End are honoured, and they follow the reading direction; any other value leaves the icon at the end. |
| ExpanderTemplate | `RenderFragment<bool>?` | null | Custom content in place of the expander icon, receiving the expanded state. It still turns over unless NoExpanderRotation is set, and HideExpanderIcon still removes it; HeaderTemplate replaces it with the rest of the header. |
| ExpandOnPrint | `bool` | false | Opens the panel on paper, so a collapsed section is not printed as a bare header, and lifts the MaxHeight scroll cap. Content not in the DOM (a never-opened LazyContent panel, a collapsed UnmountOnCollapse one) still cannot print. |
| HeaderAriaLabel | `string?` | null | Gets or sets the accessible label of the toggle button in the header, for a header whose own content does not name it - an icon-only HeaderTemplate, most of all. |
| HeaderTemplate | `RenderFragment<bool>?` | null | Used to customize the header of the accordion. It replaces the whole default header, the expander icon included, and receives the current expanded state. |
| HeadingLevel | `int?` | null | Gets or sets the heading level (aria-level) reported for the header of the accordion, so that it takes its right place in the heading outline of the page. The default value is 3 - or one level below the accordion this one is nested in - and the value is clamped to the 1..6 range. |
| HiddenUntilFound | `bool` | false | Hands the collapsed panel to the browser as hidden="until-found", so find-in-page and a navigation to a fragment inside it reach the text and expand the accordion around the match (reported to OnToggling with the Reveal reason). The panel stays in the DOM, so LazyContent and UnmountOnCollapse are ignored; a disabled, read-only or one-way bound accordion is not offered to find-in-page. |
| HideExpanderIcon | `bool` | false | Removes the expander icon from the header of the accordion. |
| Icon | `BitIconInfo?` | null | Gets or sets the icon to display at the start of the header using custom CSS classes for external icon libraries. Takes precedence over IconName when both are set. |
| IconName | `string?` | null | Gets or sets the name of the icon to display at the start of the header from the built-in Fluent UI icons. |
| IsExpanded | `bool` | false | Determines whether the accordion is expanded or collapsed. (two-way bound) |
| LazyContent | `bool` | false | Delays the first render of the content of the accordion until it is expanded for the first time. The content stays in the DOM afterwards, so the state it holds survives a collapse. Ignored while HiddenUntilFound is on. |
| MaxHeight | `string?` | null | Gets or sets the maximum height of the content of the accordion (any CSS length), beyond which the content scrolls inside the accordion instead of growing it. The scrolling region is focusable, so that it can be scrolled by the keyboard as well. |
| NoBorder | `bool` | false | Removes the default border of the accordion and gives a background color to the body. |
| NoContentRegion | `bool` | false | Removes the region role (a landmark) from the panel, leaving a plain container. The WAI-ARIA authoring practices ask for it where more than about six panels can be open at once, so the landmarks do not flood the page. |
| NoExpanderRotation | `bool` | false | Keeps the expander icon still instead of turning it over when the accordion is expanded. |
| OnClick | `EventCallback<MouseEventArgs>` | | Callback that is called when the header is clicked. |
| OnChange | `EventCallback<bool>` | | Callback that is called when the IsExpanded value has changed. |
| OnCollapse | `EventCallback` | | Callback that is called when the accordion is collapsed. |
| OnExpand | `EventCallback` | | Callback that is called when the accordion is expanded. |
| OnToggling | `EventCallback<BitAccordionToggleArgs>` | | Called before the accordion expands or collapses; set Cancel to refuse the change. It is awaited, so it can load the panel's content or ask for a confirmation first, and the header reports busy meanwhile. A change made through the IsExpanded parameter itself is not offered here. |
| ReadOnly | `bool` | false | Leaves the accordion where it is: the header keeps its colors and its place in the tab order, and reports itself as aria-disabled, but it no longer answers the pointer or the keyboard. OnClick still reports the click, and the Expand, Collapse and Toggle methods still drive the accordion. |
| Size | `BitSize?` | null | Gets or sets the size of the accordion, which drives the padding of the header and of the panel and the type scale of the whole component. An explicit value wins over the --bit-Accordion-* size variables; left unset, the accordion is medium unless they say otherwise. |
| Styles | `BitAccordionClassStyles?` | null | Custom CSS styles for different parts of the accordion. |
| Title | `string?` | null | Title in the header of the accordion, which also names the header button and the panel for assistive technologies (the Description describes them). |
| TitleTemplate | `RenderFragment?` | null | The custom content to render in place of the Title, leaving the rest of the header - the icon, the description and the expander - as it is. Unlike HeaderTemplate, which replaces the whole header, this only takes the place of the title text. |
| TransitionDuration | `int?` | null | Gets or sets the duration of the expand/collapse transition in milliseconds, overriding the duration the theme provides. A reduced-motion preference still collapses it, unless the ForceAnimation parameter opts out of that. |
| UnmountOnCollapse | `bool` | false | Removes the content of the accordion from the DOM while it is collapsed, so that nothing it holds keeps running behind a closed header. The collapse of an accordion that unmounts its content is not animated, since there is nothing left to animate. Ignored while HiddenUntilFound is on. |
| AriaLabel | `string?` | null | Gets or sets the accessible label for the component, used by assistive technologies. |
| Class | `string?` | null | Gets or sets the CSS class name(s) to apply to the rendered element. |
| Dir | `BitDir?` | null | Gets or sets the text directionality for the component's content. |
| Disabled | `bool` | false | Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction. |
| ForceAnimation | `bool` | false | Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. |
| HtmlAttributes | `Dictionary<string, object>` | new Dictionary<string, object>() | Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. An attribute written on the component wins over an entry of the same name. |
| Id | `string?` | null | Gets or sets the unique identifier for the component's root element. |
| Style | `string?` | null | Gets or sets the CSS style string to apply to the rendered element. |
| TabIndex | `string?` | null | Gets or sets the tab order index for the component when navigating with the keyboard. |
| Visibility | `BitVisibility` | BitVisibility.Visible | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. |
## Public Members
| Name | Type | Default Value | Description |
| :--- | :--- | :------------ | :---------- |
| Expand | `Task` | | Expands the accordion. Does nothing if it is already expanded, and reports the change through the IsExpanded binding, OnChange and OnExpand. |
| Collapse | `Task` | | Collapses the accordion. Does nothing if it is already collapsed, and reports the change through the IsExpanded binding, OnChange and OnCollapse. |
| Toggle | `Task` | | Expands the accordion if it is collapsed and collapses it if it is expanded, reporting the change through the IsExpanded binding, OnChange and OnExpand/OnCollapse. |
| FocusAsync | `ValueTask` | | Gives the focus to the header of the accordion, so that a panel the app has just opened is also where the keyboard is standing. The overload taking a bool prevents the header from being scrolled into view. |
| UniqueId | `Guid` | Guid.NewGuid() | Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed. |
| RootElement | `ElementReference` | | Gets the reference to the root HTML element associated with this component. |
## Enums
### BitColorKind Enum
| Name | Value | Description |
| :--- | :--- | :---------- |
| Primary | 0 | The primary color kind. |
| Secondary | 1 | The secondary color kind. |
| Tertiary | 2 | The tertiary color kind. |
| Transparent | 3 | The transparent color kind. |
### BitPlacement Enum
| Name | Value | Description |
| :--- | :--- | :---------- |
| Top | 0 | The top edge. |
| Bottom | 1 | The bottom edge. |
| Start | 2 | The edge the reading direction starts from - the left in LTR, the right in RTL. On the vertical axis, which does not turn around, it is the top. |
| End | 3 | The edge the reading direction ends at - the right in LTR, the left in RTL. On the vertical axis, which does not turn around, it is the bottom. |
| Left | 4 | The left edge, in both reading directions. |
| Right | 5 | The right edge, in both reading directions. |
| Center | 6 | The middle of the axis, against neither edge. |
| TopAndBottom | 7 | Both edges of the block axis at once. |
| StartAndEnd | 8 | Both edges of the inline axis at once, following the reading direction the way Start and End do. |
### BitAccordionToggleReason Enum
| Name | Value | Description |
| :--- | :--- | :---------- |
| Click | 0 | The header of the accordion was clicked, or activated by the Enter or the Space key. |
| Method | 1 | The Expand, Collapse or Toggle method of the accordion was called. |
| Reveal | 2 | The browser revealed the collapsed panel of a HiddenUntilFound accordion, because find-in-page or a navigation to a fragment landed inside it. |
### BitSize Enum
| Name | Value | Description |
| :--- | :--- | :---------- |
| Small | 0 | The small size. |
| Medium | 1 | The medium size. |
| Large | 2 | The large size. |
### BitVisibility Enum
| Name | Value | Description |
| :--- | :--- | :---------- |
| Visible | 0 | The content of the component is visible. |
| Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). |
| Collapsed | 2 | The component is hidden (display:none). |
### BitDir Enum
| Name | Value | Description |
| :--- | :--- | :---------- |
| Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). |
| Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). |
| Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. |
## Sub Classes
### BitAccordionToggleArgs Properties
| Name | Type | Default Value | Description |
| :--- | :--- | :------------ | :---------- |
| IsExpanding | `bool` | | The state the accordion is about to move to: true while it is expanding, false while it is collapsing. |
| Reason | `BitAccordionToggleReason` | | What made the accordion expand or collapse: a click on its header, a call to one of its Expand, Collapse and Toggle methods, or a find-in-page match the browser revealed. |
| Cancel | `bool` | false | Set to true to cancel the expansion or the collapse and leave the accordion as it is. |
### BitAccordionClassStyles Properties
| Name | Type | Default Value | Description |
| :--- | :--- | :------------ | :---------- |
| Root | `string?` | null | Custom CSS classes/styles for the root element of the BitAccordion. |
| Expanded | `string?` | null | Custom CSS classes/styles for the expanded state of the BitAccordion. |
| HeaderWrapper | `string?` | null | Custom CSS classes/styles for the header wrapper of the BitAccordion, which holds the heading and the actions. |
| Heading | `string?` | null | Custom CSS classes/styles for the heading element of the BitAccordion that wraps the header button. |
| Header | `string?` | null | Custom CSS classes/styles for the header of the BitAccordion. |
| Icon | `string?` | null | Custom CSS classes/styles for the icon at the start of the header of the BitAccordion. |
| HeaderContent | `string?` | null | Custom CSS classes/styles for the header content of the BitAccordion. |
| Title | `string?` | null | Custom CSS classes/styles for the title of the BitAccordion. |
| Description | `string?` | null | Custom CSS classes/styles for the description of the BitAccordion. |
| ExpanderIconWrapper | `string?` | null | Custom CSS classes/styles for the expander icon wrapper of the BitAccordion. |
| ExpanderIcon | `string?` | null | Custom CSS classes/styles for the expander icon of the BitAccordion. |
| ExpandedIcon | `string?` | null | Custom CSS classes/styles for the icon of the BitAccordion in expanded state. |
| Spinner | `string?` | null | Custom CSS classes/styles for the spinner that stands in the expander's slot while the BitAccordion is busy. |
| Actions | `string?` | null | Custom CSS classes/styles for the actions of the BitAccordion, rendered beside the header. |
| ContentContainer | `string?` | null | Custom CSS classes/styles for the content container of the BitAccordion. |
| ContentWrapper | `string?` | null | Custom CSS classes/styles for the content wrapper of the BitAccordion, which clips the content while it collapses. |
| Content | `string?` | null | Custom CSS classes/styles for the content of the BitAccordion. |
## CSS Variables
Public CSS custom properties read off the component's root. Set one on `:root` to restyle every instance, on any ancestor to restyle the ones inside it, or on the `Style` of one instance to restyle it and every instance nested inside it, which inherits the value too - a parameter changes one alone, as does the real CSS property on its `Style` / `Styles` when that property does not inherit (`opacity`); an inherited one (`color`, `font-family`) reaches the nested instances that do not set it themselves.
| Name | Default Value | Description |
| :--- | :------------ | :---------- |
| `--bit-Accordion-color` | --bit-clr-fg-pri | Text color of the accordion. |
| `--bit-Accordion-background` | --bit-clr-bg-pri (--bit-clr-bg-sec with NoBorder) | Fill of the accordion. The Background parameter wins over it. |
| `--bit-Accordion-border-color` | --bit-clr-brd-pri | Color of the outline. The Border parameter wins over it. |
| `--bit-Accordion-border-width` | --bit-shp-brd-width | Thickness of the outline. |
| `--bit-Accordion-radius` | --bit-shp-radius-surface | Corner radius of the accordion, which the header and the panel follow. |
| `--bit-Accordion-shadow` | none | Elevation of the accordion (e.g. var(--bit-shd-card)). |
| `--bit-Accordion-font-size` | --bit-tpg-fs-sm | Text size of the panel and the description. The Size parameter wins over it. |
| `--bit-Accordion-header-padding` | spacing(1.5) | Padding of the header (any padding shorthand). The Size parameter wins over it. |
| `--bit-Accordion-header-hover-background` | --bit-clr-bg-pri-hover (--bit-clr-bg-sec-hover with NoBorder) | Fill of the header under the pointer. The Background parameter wins over it. |
| `--bit-Accordion-header-active-background` | The hover fill, then --bit-clr-bg-pri-active (--bit-clr-bg-sec-active with NoBorder) | Fill of the header while pressed. The Background parameter wins over it. |
| `--bit-Accordion-header-expanded-background` | transparent | Fill of the header while the accordion is expanded; once set, the hover and pressed shades no longer replace it. |
| `--bit-Accordion-header-expanded-color` | inherit | Text of the header while the accordion is expanded. The title, icon and expander colors win over it; nested accordions do not inherit it. |
| `--bit-Accordion-title-color` | inherit | Color of the title. |
| `--bit-Accordion-title-font-size` | --bit-tpg-fs-md | Size of the title. The Size parameter wins over it. |
| `--bit-Accordion-title-font-weight` | --bit-tpg-fw-semibold | Weight of the title. |
| `--bit-Accordion-description-color` | --bit-clr-fg-sec | Color of the description. |
| `--bit-Accordion-icon-size` | --bit-siz-icon-md | Size of the icon, of the expander icon and of the busy spinner. The Size parameter wins over it. |
| `--bit-Accordion-icon-color` | inherit | Color of the icon at the start of the header. |
| `--bit-Accordion-expander-color` | inherit | Color of the expander icon (or of the ExpanderTemplate content) and of the busy spinner. |
| `--bit-Accordion-content-padding` | spacing(1.5) | Padding of the open panel (any padding shorthand); its block padding animates from 0. The Size parameter wins over it. |
| `--bit-Accordion-content-background` | transparent | Fill of the panel, drawn over the accordion's own fill. |
| `--bit-Accordion-divider-color` | transparent | Rule between the header and the open panel, as thick as the outline. |
| `--bit-Accordion-focus-color` | --bit-clr-pri-focus | Keyboard focus ring of the header and of a scrolling panel. |
| `--bit-Accordion-disabled-color` | --bit-clr-fg-dis | Text of a disabled accordion. |
| `--bit-Accordion-disabled-background` | --bit-clr-bg-dis | Fill of a disabled accordion. |
## Examples
\n**Basic**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
\n**Expander icon**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
\n**Actions**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
```csharp
private int renameCount;
```
\n**Binding**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
```csharp
private bool bindingIsDisabled;
private bool bindingIsExpanded;
private int controlledExpandedItem = 1;
```
\n**Events**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Expand
Collapse
Toggle
Expand & focus
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
```csharp
private BitAccordion accordionRef = default!;
```
\n**Content rendering**:
```razor
@foreach (var order in orders)
{
```
```csharp
private string[] orders = [];
private async Task LoadOrders(BitAccordionToggleArgs args)
{
if (args.IsExpanding is false || orders.Length > 0) return;
await Task.Delay(1500); // e.g. await Http.GetFromJsonAsync("api/orders")
orders = ["#1001 - 2 items", "#1002 - 5 items", "#1003 - 1 item"];
}
```
\n**MaxHeight & Transition**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
These placeholder words symbolize the beginning - a moment of possibility where creativity has yet to take shape.
Imagine this text as the scaffolding of something remarkable, a foundation upon which connections and
inspirations will be built. Soon, these lines will transform into narratives that provoke thought,
spark emotion, and resonate with those who encounter them. This space is yours to craft, yours to shape.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
\n**Find & print**:
```razor
Citrus like the tangerine ships overnight in insulated boxes; berries ship on the next business day.
Orders can be changed until they are packed, usually within two hours of checkout.
Returns are free within thirty days of delivery.
```
\n**Templates**:
```razor
Advanced settings
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
@(isExpanded ? "Less" : "More")
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
`BitAccordionDemo.razor.scss`:
```scss
.custom-header {
gap: 1rem;
flex-grow: 1;
display: flex;
line-height: 1.5;
align-items: center;
}
.custom-title {
font-weight: 600;
color: var(--bit-clr-pri);
}
.custom-desc {
color: var(--bit-clr-fg-sec);
}
```
\n**Read-only**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
```csharp
private int readOnlyClickCount;
```
\n**Accessibility**:
```razor
A link Tab only reaches while this panel is open.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
\n**Cascading parameters**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
```csharp
private readonly BitAccordionParams[] accordionParams =
[
new()
{
HiddenUntilFound = true,
ExpanderIconName = BitIconName.Add,
ExpandedExpanderIconName = BitIconName.Remove,
ExpanderIconPlacement = BitPlacement.Start,
}
];
```
\n**Color**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
```csharp
private BitColorKind backgroundColorKind = BitColorKind.Primary;
private BitColorKind borderColorKind = BitColorKind.Primary;
```
\n**External Icons**:
```razor
ExpanderIcon=@("fa-solid fa-chevron-down")
Icon="@BitIconInfo.Fa("solid gear")"
ExpanderIcon="@BitIconInfo.Css("bi bi-chevron-down")"
Icon="@BitIconInfo.Bi("gear")"
```
\n**Size**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
\n**Style & Class**:
```razor
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
Every story starts with a blank canvas, a quiet space waiting to be filled with ideas, emotions, and dreams.
```
`BitAccordionDemo.razor.scss`:
```scss
.faq-accordions {
gap: 0.5rem;
display: flex;
flex-flow: column;
// The variables inherit, so one block on an ancestor re-skins every accordion underneath it.
--bit-Accordion-radius: 0.75rem;
--bit-Accordion-header-padding: 1rem 1.25rem;
--bit-Accordion-content-padding: 1rem 1.25rem;
--bit-Accordion-border-color: color-mix(in srgb, var(--bit-clr-pri) 35%, transparent);
--bit-Accordion-header-hover-background: color-mix(in srgb, var(--bit-clr-pri) 8%, transparent);
--bit-Accordion-header-active-background: color-mix(in srgb, var(--bit-clr-pri) 16%, transparent);
--bit-Accordion-header-expanded-background: color-mix(in srgb, var(--bit-clr-pri) 12%, transparent);
--bit-Accordion-divider-color: color-mix(in srgb, var(--bit-clr-pri) 35%, transparent);
--bit-Accordion-title-color: var(--bit-clr-pri);
--bit-Accordion-expander-color: var(--bit-clr-pri);
}
::deep {
.custom-class {
border-color: blueviolet;
background-color: color-mix(in srgb, blueviolet 12%, transparent);
}
.custom-acd-title {
color: tomato;
font-style: italic;
}
.custom-acd-content {
font-family: monospace;
}
}
```
\n**RTL**:
```razor
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است.
```
Clicks: @clickCount, last OnChange: @lastChange
Expanded: @expandCount, collapsed: @collapseCount, refused: @refusedCount
```
```csharp
private int clickCount;
private bool lastChange;
private int expandCount;
private int collapseCount;
private int refusedCount;
private bool lockAccordion;
private void HandleOnToggling(BitAccordionToggleArgs args)
{
if (args.IsExpanding || lockAccordion is false) return;
args.Cancel = true;
refusedCount++;
}
```
\n**Programmatic control**:
```razor
@order
}
HeaderTemplate
@(isExpanded ? "Open" : "Closed")