Surfaces
Card
Card is the surface a single subject lives on. On its own it is a padded box with the corner, the paint and the shadow of the current theme; give it a title, an icon, a cover picture, a row of actions or a footer and it lays those parts out for you, edge to edge where the picture needs it and inset everywhere else. The cover can sit above the content, beside it, after it, or behind it as a hero, cropped to a height or an aspect ratio of your own. It comes in three sizes and across the whole color palette in three variants, with a 25-step elevation ramp, an outline instead of a shadow and square corners. Give it a click handler and it becomes a real control that answers Enter and Space; give it a URL and it lays an accessible block link over its own surface without swallowing the buttons in its header and footer; bind its Selected value and it becomes a card a reader can pick.
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)Header
bit BlazorUI components are native, easy-to-customize, and ...
A title given a heading level reports itself as one to assistive technologies.
An IconTemplate leads the header and leaves the title and the subtitle where they are.
A HeaderTemplate takes the place of the icon, the title and the subtitle.
Cover
16 / 9, 1 / 1, 4 / 3 - which is what a responsive grid wants: a fixed height
keeps a row of cards level only until the column narrows, while a ratio keeps it level at every width.
ImagePosition says which part of the picture survives that crop - top for a portrait whose face
sits high in the frame, bottom for a landscape whose horizon sits low - instead of the middle the browser
keeps by default. Reversed moves the cover under the content instead of over it, which is the shape a caption
card wants. CoverOverlay moves the cover behind the content rather than above
it, which is the hero card: give the card a Height of its own, since a cover behind the content no longer makes
the card as tall as the picture, and a foreground the words can be read against - the picture carries no scrim.

A cover runs edge to edge and is clipped to the corner of the card.

A cover given a ratio stays at that ratio however wide the card ends up.

The crop is taken from the top rather than from the middle.

Reversed puts the header and the body over the picture instead of under it.
The Cover template takes the place of the image.

An overlaid cover fills the card and the content is written over it.
Actions & Footer
Actions sit beside the title; the footer sits under the body.

The star floats over the picture. Starred: False
And the same card with a rule between each part and the next.
Horizontal

A horizontal card is a thumbnail and a summary on one row.

CoverWidth pins the thumbnail to a fixed width.

Reversed puts the thumbnail after the words instead of before them.
Click
Clicked 0 times.
This one answers nothing.
Link
aria-labelledby of your own, the Title or the
Subtitle - in that order - so a page of linked cards reads as a list of destinations rather than a list of
identical links, and the name is handed to the anchor rather than left on the card as a second copy. Target and
Rel reach that anchor; a card opening in a new tab gets rel="noopener" on its own, and
Download turns the whole card into the thing that saves the file it points at. Everything in Actions,
Footer and FloatingActions stays above the anchor and keeps working - and keeps its click to itself, so
a linked card that also has an OnClick is not fired by the buttons inside it. A linked card takes no tab stop
of its own: the anchor is the one control over the surface, and a TabIndex goes to it rather than to the
wrapper around it. What the anchor does cover is the text of the body, which a reader can no longer select with the
pointer - the price the block-link pattern pays wherever it is used.
Selection
aria-pressed. A picked card is marked
with a ring rather than a new fill, so the state survives whatever Color the card is already wearing: the ring is
drawn in the primary color, or in the fill's own foreground on a card that is already painted in a role. It is painted
over the edge of the card rather than added to it, so picking through a grid of cards moves nothing. A card that is a
button through OnClick reports the state as well while it carries it, even where the app sets Selected
itself rather than binding it - a control whose state only the sighted reader can see is not a state at all. A card
splatted with a role that carries a selection of its own - option, row, gridcell,
tab, treeitem - reports it through aria-selected instead, which is the state
those roles answer to; that is what a grid or a listbox built out of cards needs.
Selected: True
Selected: False
Hoverable
The shadow answers the pointer.
Loading
Elevation
--bit-shd-0 to
--bit-shd-24). 0 is a flat card with no shadow at all, which is the same thing NoShadow asks
for; leaving it unset keeps the shadow the theme gives every card surface. A card that lifts under the pointer lifts
from whatever level it was resting at rather than to one fixed shadow, so an elevated card still rises on hover and
still presses down on click instead of dropping the moment the pointer reaches it.
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)NoShadow
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Background
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Border
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Outlined
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Square
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)NoPadding
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Width & Height
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)This one is bounded rather than sized: it never shrinks below 12rem and never grows past 24rem.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
Line 13 of a body that outgrew its card.
FullSize
bit BlazorUI
bit BlazorUI components are native, easy-to-customize, and ...
Learn more(opens in a new tab)Accessibility
group - which is what an AriaLabel turns the card into,
since a label on an element with no role of its own is not guaranteed to be announced at all. HeadingLevel makes
the Title a real heading, so a page of cards can be walked heading by heading. A card with an OnClick
reports itself as a button, takes focus and answers Enter and Space - and gives up the heading, since the
contents of a button are named rather than read as structure; a bound Selected reports the
state through aria-pressed, or through aria-selected on a card splatted with a role that
carries one; Loading reports the card as busy; and IsEnabled="false" takes it
out of the tab order and marks it disabled - whether the card was made focusable by the card or by a TabIndex
of your own, and either way what focus it does take is drawn with a ring. A run of cards is a list, so wrap them in one
- a ul of lis, or a container with role="list" - and give that list a name of
its own. A linked card hands its name to the anchor stretched over it rather than
keeping a second copy on the wrapper - and since a HeaderTemplate takes the title and the subtitle off the card,
a linked card with a header of its own has nothing left to be named by and wants an AriaLabel.
A named card is a group, and its title is a level-3 heading.
Out of the tab order, off the pointer, marked disabled.
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
بیت بلیزور یو آی، کامپوننتهای بومی، قابل تنظیم و ...
API
Every parameter, public member, sub-class and enum this component exposes.
BitCard parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| Actions | RenderFragment? | null | The content rendered at the trailing edge of the header of the card, for whatever acts on the card as a whole. It is raised above the stretched link of a card that has an Href, so the controls in it stay clickable. |
| Background | BitColorKind? | null | The color kind of the background of the card. |
| Border | BitColorKind? | null | The color kind of the border of the card. |
| ChildContent | RenderFragment? | null | The content of the card. It renders on its own inside the padding of the card, unless the card also has a cover, a header or a footer - then it renders as the body between them. |
| Classes | BitCardClassStyles? | null | Custom CSS classes for different parts of the card. |
| Color | BitColor? | null | The general color of the card. Setting it paints the card in one of the roles of the theme instead of in the neutral surface colors, in the way the Variant asks for. |
| Cover | RenderFragment? | null | The full-bleed media at the head of the card, rendered outside the padding and clipped to the corner of the card. It takes precedence over ImageUrl. |
| CoverOverlay | bool | false | Lays the cover of the card behind its content instead of above it, filling the whole surface. The card needs a Height or a MinHeight of its own, since an overlaid cover no longer makes it as tall as the picture. |
| CoverRatio | string? | null | The aspect ratio the cover of the card is drawn at, as a CSS ratio such as 16 / 9. The cover is then sized by the ratio rather than by the picture inside it, which keeps a row of cards level while the column narrows. |
| CoverWidth | string? | null | The width of the cover of a horizontal card. The default is a third of the width of the card. |
| Divider | bool | false | Draws a hairline between the header and the body of the card and between its body and its footer. A part on the outer edge of the stack - a header with nothing under it, a footer with nothing over it - draws no rule of its own. |
| Download | string? | null | The download attribute of the stretched link of the card. |
| Elevation | int? | null | Sets the shadow elevation level of the card (0-24). Maps to theme shadow variables (--bit-shd-1 to --bit-shd-24), with 0 being a card with no shadow at all. |
| Footer | RenderFragment? | null | The content rendered under the body of the card, for the actions a reader is meant to take. It is raised above the stretched link of a card that has an Href, so the controls in it stay clickable. |
| FloatingActions | RenderFragment? | null | The content floated over the leading corner of the card, above everything else on its surface - the corner a picture card keeps its favourite toggle or its selection box in. It is raised above the stretched link of a card that has an Href, so the control in it stays clickable. |
| 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 | The custom template rendered as the header of the card, in place of the icon, the title and the subtitle. Actions still renders beside it. |
| HeadingLevel | int? | null | The heading level the title of the card reports itself as (1-6). Leaving it unset keeps the title plain text. Values outside 1-6 are ignored. |
| Height | string? | null | Sets the height of the card explicitly. |
| Horizontal | bool | false | Lays the cover of the card beside its content instead of above it. |
| Hoverable | bool | false | Lifts the card while the pointer is over it. A clickable card or a linked one lifts on its own. |
| Href | string? | null | The URL the whole card leads to, rendered as an anchor stretched over the surface of the card. The anchor is named by the AriaLabel, or failing that by the Title or the Subtitle of the card. |
| Icon | BitIconInfo? | null | The leading icon of the header of the card. |
| IconName | string? | null | The name of the leading icon of the header of the card. |
| IconTemplate | RenderFragment? | null | The custom template rendered in the leading slot of the header of the card, in place of the icon. Unlike HeaderTemplate it keeps the Title and the Subtitle beside it. |
| ImageAlt | string? | null | The alternate text of the cover image of the card. With no value it renders an empty alt, so the picture is skipped by assistive technologies. |
| ImageHeight | string? | null | The height of the cover image of the card. The image is cropped to fill it rather than stretched. |
| ImageLoading | BitImageLoading? | null | The loading behavior of the cover image of the card, eager or lazy. |
| ImagePosition | string? | null | The part of the cover image of the card that is kept in frame, as a CSS object-position such as top or 50% 20%. It only means anything on a cover that crops the picture, through ImageHeight or CoverRatio. |
| ImageUrl | string? | null | The URL of the cover image at the head of the card. |
| Loading | bool | false | Stands the body of the card in with a placeholder while its content is being fetched, and reports the card as busy. The header keeps rendering. |
| LoadingTemplate | RenderFragment? | null | The custom placeholder rendered in the body of the card 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 default padding of the card. |
| NoShadow | bool | false | Removes the default shadow around the card. |
| OnClick | EventCallback<MouseEventArgs> | The callback for when the card is clicked. Setting it turns the card into a button: it takes focus, it answers Enter and Space, and it reports itself as a control to assistive technologies. | |
| Outlined | bool | false | Renders the card with no shadow and a primary border. An explicit Border still wins over the border color it asks for. |
| Rel | BitLinkRels? | null | The rel attribute of the stretched link of the card. With no value of its own, a card whose Target is _blank gets noopener. |
| Reversed | bool | false | Lays the cover of the card after its content instead of before it: under the body on a vertical card, on the trailing edge of a Horizontal one. |
| ScrollableBody | bool | false | Lets the content of the card scroll inside it instead of growing past the height it was given. It only means anything on a card whose height is bounded. |
| Selected | bool | false | Whether the card is currently selected. Binding it turns the card into a toggle: clicking it flips the value, and the card reports its state through aria-pressed as a button, or through aria-selected where it was given a role that carries one. |
| Size | BitSize? | null | The size of the card, which sets its padding, the gap between its parts and the type of its header. |
| Square | bool | false | Removes the border-radius from the card, rendering it with sharp corners. |
| StopPropagation | bool | false | Stops the propagation of the click event of the card. |
| Styles | BitCardClassStyles? | null | Custom CSS styles for different parts of the card. |
| Subtitle | string? | null | The second line of the header of the card, under the title. |
| Target | string? | null | The target attribute of the stretched link of the card. |
| Title | string? | null | The title of the card, rendered as the first line of its header. It also names the stretched link of a card that has an Href. |
| Variant | BitVariant? | null | The visual variant of the card, which only takes effect while a Color is set. The default is Fill. |
| Width | string? | null | Sets the width of the card explicitly. |
BitCard public members
| Name | Type | Default value | Description |
|---|---|---|---|
| FocusAsync | ValueTask | Gives focus to the card, which only lands anywhere while the card is a control or has a tab index of its own. |
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 that covers a card with an Href. |
| 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. |
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.