Card
A consistent surface for related content and actions.
Live TypeScript example
Try the component here, then use the source below in your application.
- JavaScript
- 0.6 KiB
- Component CSS
- 0.7 KiB
- Shared theme CSS
- 3.8 KiBonce per application
How sizes are measured
The JavaScript figure includes this component’s required helpers. CSS includes its styling dependencies. Each entry is bundled separately for ES2022, minified, then compressed with gzip level 9. Your bundler may share helpers across components. Images, fonts, examples and application code are excluded.
Before compression: JavaScript 1.2 KiB; component CSS 1.9 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →Card content can contain your own DOM elements, including inputs.
import '@blukavantui/web/theme.css'
import {createCard} from '@blukavantui/web/card';
import '@blukavantui/web/card.css';
export function mount(host: HTMLElement) {
const input = document.createElement("input");
input.placeholder = "Customer name";
input.setAttribute("aria-label", "Customer name");
return createCard(host, {
Title: "Customer details",
Description: "Slots accept DOM nodes or plain text.",
Content: input,
Footer: "Changes are owned by your application.",
});
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://blukavantui.blutekmedia.com/downloads/blukavantui-web-0.6.2.tgz<div id="example"></div>This example uses the downloadable @blukavantui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
createCard
Pass options as the second argument. Keep the returned instance to update options or dispose it when its view is removed.
import { createCard } from '@blukavantui/web/card';
import '@blukavantui/web/card.css';Load @blukavantui/web/theme.css once in your app shell.createCard(host: HTMLElement, options: CardOptions)Reference for @blukavantui/web 0.6.2. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
8| Name | Type / requirement | Usage |
|---|---|---|
Title | stringOptional | The displayed title. |
Description | stringOptional | Supporting text beneath the title. |
HeadingLevel | 2 | 3 | 4 | 5 | 6Optional | Heading level to fit the surrounding document hierarchy. |
IsBodyPadded | booleanOptional | |
Content | SlotOptional | Content slot: pass a DOM node or a text string. Strings are rendered as text. |
Actions | SlotOptional | Action slot: pass your own DOM node or text. |
Footer | SlotOptional | Footer slot: pass your own DOM node or text. |
ExtendedClass | stringOptional | Additional CSS class names on the component root. |
Instance methods & properties
3| Name | Signature / type | Usage |
|---|---|---|
element | HTMLElement | Root owned by this instance. Dispose before removing its host. |
update | (patch: Partial<CardOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Related data types
Expand a type for its fields and allowed values.
CommonOptions
interface CommonOptions {
ExtendedClass?: string;
}Slot
type Slot = Node | string;Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Included in the planned free BluKavantUI Community edition. The official OutSystems Forge release is coming soon. View Community scope →
Open OutSystems showcase ↗- Web runtime
- Supported
- TypeScript
- Supported
- OutSystems
- Supported
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance →Purpose and use
Use cards to group one coherent subject. Keep the heading, description, primary content, and optional footer in a predictable order.
Keyboard design guidance
The surface is not a button. Interactive content follows its natural tab order. Choose a heading level that fits the containing page.
See the support status above for review coverage and any limitations.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.