Surfaces
Card
Card is the surface for a single subject. On its own it is a padded box; give it a title, a cover, actions or a footer and it lays those parts out for you, with the cover above, beside, after or behind the content. It comes in three sizes, the whole color palette and a 25-step elevation ramp, and becomes an accessible button, block link or toggle when you need one.
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Dimensions
Width, Height and ScrollableBody: this text is long enough to scroll inside the card instead of spilling out of it, so the layout around it stays where it is.
MinWidth and MaxWidth: never narrower than 10rem, never wider than 18rem.
FullSize fills its grid cell.
So a card with more to say makes the whole row taller, and every card in the row follows it.
One height for all.
FullWidth: as wide as its container.
Header
A title and a subtitle.
An icon, and a title that is a level-3 heading.
An IconTemplate keeps the title and subtitle.
A HeaderTemplate replaces the icon, title and subtitle.
Actions & Footer
Actions beside the title, the footer under the body.
The same card with a Divider.
The star floats over the corner. Starred: False
Cover

ImageHeight crops it; ImagePosition keeps the top of the frame.

CoverRatio keeps its ratio at any width.

Reversed puts the picture last.
The Cover template takes the place of the image.
Horizontal

A thumbnail and a summary on one row.

CoverWidth pins the thumbnail width.

Reversed puts the thumbnail after the words.
Click & Selection
aria-pressed and a ring). IsEnabled="false" disables it; StopPropagation keeps the click
from its ancestors.
Clicked 0 times.
Answers nothing.
Selected: True
Selected: False
Link
_blank adds noopener.
Loading
aria-busy; the header stays.
LoadingTemplate brings a placeholder of your own.
Elevation & Hover
Appearance
NoPadding: the content touches the edges.
Accessibility
group role;
a splatted option, tab or row role makes the card itself the control and reports
aria-selected, while a structural one such as listitem keeps the stretched button. Loading sets aria-busy. Focus rings are drawn inside the card, and forced-colors mode restores
its border.
- Release notes
CSS variables
:root, on any ancestor - a plain element, as here - or on one card's Style.
A parameter set on the card still wins, and a disabled card keeps the disabled colors.
A body under a divider.

A CoverOverlay card, read against the scrim set on its own Style.
Cascading parameters
Outlined, small, divided.
The same, from BitParams.
Keeps its own Size.
Color
External Icons
Size
Small padding, small type.
Medium padding, medium type.
Large padding, large type.
Style & Class
Styled card
Classed card
Every part can be styled on its own.
And every part can take a class.
RTL
بیت بلیزور یو آی، کامپوننتهای بومی، قابل تنظیم و ...
CSS variables
The public custom properties this component reads off its root, for what no parameter covers.
Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property:
set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it,
or on the Style of one instance to restyle that one alone. Leave a variable unset and the component falls back to the theme token beside it.
BitCard CSS variables
| Name | Default value | Description |
|---|---|---|
| --bit-Card-color | --bit-clr-fg-pri | Text color. A Color on the card wins over it. |
| --bit-Card-background | --bit-clr-bg-sec | Background. A Background or a Color on the card wins over it. |
| --bit-Card-border-color | --bit-clr-brd-pri | Border color, on every card that draws a border. A Border or a Color on the card wins over it. |
| --bit-Card-border-width | 0; --bit-shp-brd-width on an Outlined card or one given a Border | Border width. Set on its own it draws a border around every card. |
| --bit-Card-radius | --bit-shp-radius-surface | Corner radius. Square wins over it. |
| --bit-Card-shadow | --bit-shd-card | Resting shadow. Elevation, NoShadow and Outlined win over it. |
| --bit-Card-hover-shadow | --bit-shd-card-hover | Shadow of a clickable, linked or Hoverable card under the pointer. An Elevation wins over it. |
| --bit-Card-active-shadow | The resting shadow | Shadow of a clickable or linked card while pressed. |
| --bit-Card-hover-background | The resting background washed 5% with the text color | Background of a clickable or linked card under the pointer. A Fill card uses its role's hover shade instead. |
| --bit-Card-active-background | The resting background washed 10% with the text color | Background of a clickable or linked card while pressed. A Fill card uses its role's pressed shade instead. |
| --bit-Card-padding | --bit-spa-card-{sm,md,lg}, per Size | Inset of the card and of each of its parts. NoPadding wins over it. |
| --bit-Card-gap | Per Size | Room between the parts, and between the header icon, text and actions. |
| --bit-Card-title-font-size | Per Size | Title text size. |
| --bit-Card-title-font-weight | --bit-tg-fw-semibold | Title text weight. |
| --bit-Card-subtitle-font-size | Per Size | Subtitle text size. |
| --bit-Card-subtitle-color | --bit-clr-fg-sec | Subtitle color. A card painted by a Color, or disabled, gives the subtitle its own text color instead. |
| --bit-Card-icon-size | --bit-siz-icon-{sm,md,lg}, per Size | Size of the header icon. |
| --bit-Card-divider-color | --bit-clr-brd-sec | Color of the Divider hairlines. |
| --bit-Card-selected-color | --bit-clr-pri | Color of the Selected ring. A Fill card draws it in its own text color instead. |
| --bit-Card-focus-color | The text color | Color of the keyboard focus ring, on the card and on the link of a linked card. |
| --bit-Card-cover-width | 33% | Width of the cover of a Horizontal card. CoverWidth wins over it. |
| --bit-Card-scrim | none | A layer painted over a CoverOverlay picture and under the content, such as a dark gradient, so the text over it stays readable. |
API
Every parameter, public member, sub-class and enum this component exposes.
BitCard parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| Actions | RenderFragment? | null | Content at the end of the header, for what acts on the whole card (a menu, a dismiss button). Its clicks never reach the card, and it stays above the link of a linked card. |
| Background | BitColorKind? | null | The neutral surface color of the card. Unset, the card reads --bit-Card-background, then the theme's secondary background. |
| Border | BitColorKind? | null | Draws a border in one of the neutral border colors. Wins over the color Outlined asks for. |
| ChildContent | RenderFragment? | null | The content of the card: the whole padded box on a plain card, the body on one with a cover, a header or a footer. |
| Classes | BitCardClassStyles? | null | Custom CSS classes for different parts of the card. |
| Color | BitColor? | null | Paints the card in a theme role, the way the Variant asks for. Unset, the card stays a neutral surface. |
| Cover | RenderFragment? | null | Full-bleed media at the top of the card (a chart, a carousel, a video), clipped to its corners. Takes precedence over ImageUrl. |
| CoverOverlay | bool | false | Lays the cover behind the content, filling the card. Give the card a Height or MinHeight, and a --bit-Card-scrim so its text stays readable. |
| CoverRatio | string? | null | The aspect ratio of the cover, as a CSS ratio such as 16 / 9. Keeps a row of cards level at any width. |
| CoverWidth | string? | null | The width of the cover of a Horizontal card. Unset, it reads --bit-Card-cover-width, then a third of the card. |
| Divider | bool | false | Draws a hairline between the header, the body and the footer - only between parts, never on the outer edge. |
| Download | string? | null | The download attribute of the link of a card that has an Href. |
| Elevation | int? | null | A level of the theme's shadow ramp (0-24, --bit-shd-0 to --bit-shd-24) the card rests at and lifts from on hover. 0 is flat. |
| FloatingActions | RenderFragment? | null | Content floated over the top corner of the card, above everything else - a favorite toggle or a selection box on a picture card. Its clicks never reach the card. |
| Footer | RenderFragment? | null | Content under the body, for the actions a reader takes. Its clicks never reach the card, and it stays above the link of a linked card. |
| FullHeight | bool | false | Makes the card height 100% of its parent container. |
| FullSize | bool | false | Makes the card width and height 100% of its parent container. |
| FullWidth | bool | false | Makes the card width 100% of its parent container. |
| HeaderTemplate | RenderFragment? | null | Replaces the icon, the title and the subtitle; Actions still renders beside it. A linked or clickable card with one is named by its body; an AriaLabel says it shorter. |
| HeadingLevel | int? | null | Makes the title a heading of this level (1-6). Ignored under a splatted role that presents its children, such as option or tab. |
| Height | string? | null | Sets the height of the card explicitly. |
| Horizontal | bool | false | Lays the cover beside the content instead of above it. |
| Hoverable | bool | false | Lifts the card under the pointer. A clickable or linked card lifts on its own. |
| Href | string? | null | Stretches a link to this URL over the whole card, named by the AriaLabel, an aria-labelledby, the Title, the Subtitle (which describes a link the Title names) or the body, or else by all the card says. Actions, Footer and FloatingActions stay above it; the rest of the card is under it. |
| Icon | BitIconInfo? | null | The header icon from an external library. Takes precedence over IconName. |
| IconName | string? | null | The name of the header icon from the built-in Fluent UI icons. |
| IconTemplate | RenderFragment? | null | Replaces only the header icon (an avatar, a logo) and keeps the Title and the Subtitle beside it. |
| ImageAlt | string? | null | The alternate text of the cover image. Unset, the image is decorative (an empty alt) and skipped by screen readers. |
| ImageHeight | string? | null | The height of the cover image, which is cropped to fill it rather than stretched. |
| ImageLoading | BitImageLoading? | null | The loading behavior of the cover image, eager or lazy. |
| ImagePosition | string? | null | Which part of a cropped cover image stays in frame, as a CSS object-position such as top or 50% 20%. |
| ImageUrl | string? | null | The URL of the cover image at the top of the card. |
| Loading | bool | false | Swaps the body for a placeholder and marks the card aria-busy. The header keeps rendering. |
| LoadingTemplate | RenderFragment? | null | A custom placeholder for the body while Loading is set. |
| MaxHeight | string? | null | Sets the maximum height of the card. |
| MaxWidth | string? | null | Sets the maximum width of the card. |
| MinHeight | string? | null | Sets the minimum height of the card. |
| MinWidth | string? | null | Sets the minimum width of the card. |
| NoPadding | bool | false | Removes the inset of the card and of all its parts. |
| NoShadow | bool | false | Removes the resting shadow. The card still lifts on hover when it is clickable, linked or Hoverable. |
| OnClick | EventCallback<MouseEventArgs> | Stretches a native button over the card, named like the link of Href, so the title stays a heading and Actions, Footer and FloatingActions stay separate controls. The button lets the pointer through, so the body still scrolls and its controls still answer the pointer. Under a splatted widget role (option, tab, row) the card itself is the control; a structural one (listitem, article) keeps the button. | |
| Outlined | bool | false | Trades the shadow for a border. An explicit Border still decides its color. |
| Rel | BitLinkRels? | null | The rel attribute of the link of a card that has an Href. A Target of _blank always adds noopener. |
| Reversed | bool | false | Puts the cover after the content: under the body, or at the end of a Horizontal card. |
| ScrollableBody | bool | false | Scrolls content that outgrows a bounded height; on a card with a header and a footer only the body scrolls. |
| Selected | bool | false | Draws the selection ring. Binding it makes the card a toggle whose button reports aria-pressed, or aria-selected under a splatted option, row, gridcell, tab or treeitem role, or aria-checked under a splatted checkbox, switch or radio role. |
| Size | BitSize? | null | Scales the padding, the gaps and the header type together. |
| Square | bool | false | Removes the corner radius. |
| StopPropagation | bool | false | Stops the click of the card from reaching its ancestors. |
| Styles | BitCardClassStyles? | null | Custom CSS styles for different parts of the card. |
| Subtitle | string? | null | The second line of the header, under the title. |
| Target | string? | null | The target attribute of the link of a card that has an Href. |
| Title | string? | null | The first line of the header. It also names the link of a linked card. |
| Variant | BitVariant? | null | How a Color is applied: Fill (the default) paints the surface, Outline the border, Text tints the surface; the last two write in the role's readable foreground shade. Ignored without a Color. |
| Width | string? | null | Sets the width of the card explicitly. |
BitCard public members
| Name | Type | Default value | Description |
|---|---|---|---|
| FocusAsync | ValueTask | Focuses the card: the stretched link or button of a linked or clickable card, or else the root of one given a role or a TabIndex. |
BitComponentBase parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| 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. |
| 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. |
| Id | string? | null | Gets or sets the unique identifier for the component's root element. |
| IsEnabled | bool | true | Gets or sets a value indicating whether the component is enabled and can respond to user interaction. |
| 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. |
BitComponentBase public members
| Name | Type | Default value | Description |
|---|---|---|---|
| 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. |
BitCardClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitCard. |
| Link | string? | null | Custom CSS classes/styles for the stretched link (Href) or button (OnClick) that covers the card. |
| FloatingActions | string? | null | Custom CSS classes/styles for the slot floated over the corner of the BitCard. |
| Cover | string? | null | Custom CSS classes/styles for the full-bleed media area at the head of the BitCard. |
| Image | string? | null | Custom CSS classes/styles for the image rendered from the ImageUrl of the BitCard. |
| Main | string? | null | Custom CSS classes/styles for the element that holds the header, the body and the footer of the BitCard. |
| Header | string? | null | Custom CSS classes/styles for the header of the BitCard. |
| Icon | string? | null | Custom CSS classes/styles for the leading icon of the header of the BitCard. |
| HeaderText | string? | null | Custom CSS classes/styles for the element that holds the title and the subtitle of the BitCard. |
| Title | string? | null | Custom CSS classes/styles for the title of the BitCard. |
| Subtitle | string? | null | Custom CSS classes/styles for the subtitle of the BitCard. |
| Actions | string? | null | Custom CSS classes/styles for the actions rendered at the trailing edge of the header of the BitCard. |
| Body | string? | null | Custom CSS classes/styles for the body of the BitCard, which is what the ChildContent renders into. |
| Footer | string? | null | Custom CSS classes/styles for the footer of the BitCard. |
| Selected | string? | null | Custom CSS classes/styles for the root element of the BitCard while it is selected. |
BitIconInfo properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Name | string? | null | Gets or sets the name of the icon. |
| BaseClass | string? | null | Gets or sets the base CSS class for the icon. For built-in Fluent UI icons, this defaults to "bit-icon". For external icon libraries like FontAwesome, you might set this to "fa" or leave empty. |
| Prefix | string? | null | Gets or sets the CSS class prefix used before the icon name. For built-in Fluent UI icons, this defaults to "bit-icon--". For external icon libraries, you might set this to "fa-" or leave empty. |
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. |
BitColor enum
| Name | Value | Description |
|---|---|---|
| Primary | 0 | Primary general color. |
| Secondary | 1 | Secondary general color. |
| Tertiary | 2 | Tertiary general color. |
| Info | 3 | Info general color. |
| Success | 4 | Success general color. |
| Warning | 5 | Warning general color. |
| SevereWarning | 6 | SevereWarning general color. |
| Error | 7 | Error general color. |
| PrimaryBackground | 8 | Primary background color. |
| SecondaryBackground | 9 | Secondary background color. |
| TertiaryBackground | 10 | Tertiary background color. |
| PrimaryForeground | 11 | Primary foreground color. |
| SecondaryForeground | 12 | Secondary foreground color. |
| TertiaryForeground | 13 | Tertiary foreground color. |
| PrimaryBorder | 14 | Primary border color. |
| SecondaryBorder | 15 | Secondary border color. |
| TertiaryBorder | 16 | Tertiary border color. |
BitImageLoading enum
| Name | Value | Description |
|---|---|---|
| Eager | 0 | The default behavior of the browser: the image is fetched as soon as the img element is processed. |
| Lazy | 1 | The image is fetched only once the browser estimates that it is about to be needed. |
BitSize enum
| Name | Value | Description |
|---|---|---|
| Small | 0 | The small size. |
| Medium | 1 | The medium size. |
| Large | 2 | The large size. |
BitVariant enum
| Name | Value | Description |
|---|---|---|
| Fill | 0 | Fill styled variant. |
| Outline | 1 | Outline styled variant. |
| Text | 2 | Text styled variant. |
BitLinkRels enum
| Name | Value | Description |
|---|---|---|
| Alternate | 1 | Provides a link to an alternate representation of the document. (i.e. print page, translated or mirror) |
| Author | 2 | Provides a link to the author of the document. |
| Bookmark | 4 | Permanent URL used for bookmarking. |
| External | 8 | Indicates that the referenced document is not part of the same site as the current document. |
| Help | 16 | Provides a link to a help document. |
| License | 32 | Provides a link to licensing information for the document. |
| Next | 64 | Provides a link to the next document in the series. |
| NoFollow | 128 | Links to an unendorsed document, like a paid link. ("NoFollow" is used by Google, to specify that the Google search spider should not follow that link) |
| NoOpener | 256 | Requires that any browsing context created by following the hyperlink must not have an opener browsing context. |
| NoReferrer | 512 | Makes the referrer unknown. No referrer header will be included when the user clicks the hyperlink. |
| Prev | 1024 | The previous document in a selection. |
| Search | 2048 | Links to a search tool for the document. |
| Tag | 4096 | A tag (keyword) for the current document. |
| Me | 8192 | Indicates that the linked document represents the person who owns the current content. (used for identity verification) |
| Opener | 16384 | Requires that any browsing context created by following the hyperlink keeps its opener browsing context. (reverses the implicit noopener modern browsers apply to _blank targets) |
| PrivacyPolicy | 32768 | Links to the privacy policy that applies to the current document. (rendered as privacy-policy) |
| Sponsored | 65536 | Marks the link as an advertisement or paid placement, so search engines do not count it as an organic endorsement. |
| TermsOfService | 131072 | Links to the terms of service that apply to the current document. (rendered as terms-of-service) |
| Ugc | 262144 | Marks the link as user-generated content, like forum posts or comments, for search engines. |
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. |
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.