Feedback
Feedback
Feedback element
Longer description of the feedback message.
<Feedback
icon
variant="success"
title="Feedback element"
description="Longer description of the feedback message."
/>
Table
Table
Name | Type | Description |
---|---|---|
title | string | The title of the document |
summary | string | A brief summary of the document content |
updatedAt | string | The date when the document was last updated |
navLabel | string | The label used in navigation menus |
<Table
data={{
headers: [
{ content: "Name", key: "name", sortable: true },
{ content: "Type", key: "type", sortable: true },
{ content: "Description", key: "description" }
],
rows: [
["title", "string", "The title of the document"],
["summary", "string", "A brief summary of the document content"],
["updatedAt", "string", "The date when the document was last updated"],
["navLabel", "string", "The label used in navigation menus"]
]
}}
/>
Code
CodeBlock
CodeBlock
// Full component syntax
<CodeBlock
codeInstances={[
{
code: "console.log('Hello, World!');",
language: "javascript",
label: "Example"
}
]}
/>
// Short syntax example
```tsx
function greeting(name) {
return `Hello, ${name}!`;
}
console.log(greeting('World'));
```
InlineCode
InlineCode
const x = 10;
// Full component syntax
<InlineCode>
const x = 10;
</InlineCode>
// Short syntax example
`const x = 10;`
Accordion
Accordion
Section 1
Section 2
Section 3
<AccordionGroup
items={[
{
title: "Section 1",
content: <Text>This is the content for section 1.</Text>
},
{
title: "Section 2",
content: <Text>This is the content for section 2.</Text>
},
{
title: "Section 3",
content: <Text>This is the content for section 3.</Text>
}
]}
/>
Button
Button
<Row gap="8">
<Button variant="primary" label="Primary" />
<Button variant="secondary" label="Secondary" />
<Button variant="tertiary" label="Tertiary" />
</Row>
Card
Card
<Card
href=" "
maxWidth={20}
radius="l-4"
direction="column"
padding="4"
>
<SmartImage src="/images/projects/project-01/cover-01.jpg" aspectRatio="16/9" radius="l" sizes="400px" />
<Column fillWidth padding="12" gap="8" horizontal="start">
<Text variant="heading-strong-m" onBackground="neutral-strong" align="left">
Card Title
</Text>
<Text variant="body-default-s" onBackground="neutral-weak" align="left">
This is a description of the card. It can contain multiple lines of text.
</Text>
</Column>
</Card>
Icon
Icon
<Icon name="rocket" size="m" />
<Icon name="close" size="m" />
<Icon name="check" onBackground="success-medium" size="m" />
<Icon name="infoCircle" onBackground="info-medium" size="m" />
<Icon name="warningTriangle" onBackground="warning-medium" size="m" />
<Icon name="chevronDown" size="m" />
<Icon name="search" size="m" />
Layout
Flex
Layout
Row Item
Row Item
Row Item
Row Item
Row Item
Row Item
Row Item
Row Item
<Row
fillWidth
mobileDirection="column"
gap="16"
>
<Column fillWidth border="neutral-alpha-medium" padding="16" radius="m">
<Row padding="8">Row Item</Row>
<Row padding="8">Row Item</Row>
</Column>
<Column fillWidth border="neutral-alpha-medium" padding="16" radius="m">
<Row padding="8">Row Item</Row>
<Row padding="8">Row Item</Row>
</Column>
<Column fillWidth border="neutral-alpha-medium" padding="16" radius="m">
<Row padding="8">Row Item</Row>
<Row padding="8">Row Item</Row>
</Column>
<Column fillWidth border="neutral-alpha-medium" padding="16" radius="m">
<Row padding="8">Row Item</Row>
<Row padding="8">Row Item</Row>
</Column>
</Row>
Grid
Layout
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
<Grid
fillWidth
columns="3"
mobileColumns="2"
gap="16"
>
<Column border="neutral-alpha-medium" padding="16" radius="m">
<Text>Grid Item</Text>
</Column>
<Column border="neutral-alpha-medium" padding="16" radius="m">
<Text>Grid Item</Text>
</Column>
<Column border="neutral-alpha-medium" padding="16" radius="m">
<Text>Grid Item</Text>
</Column>
<Column border="neutral-alpha-medium" padding="16" radius="m">
<Text>Grid Item</Text>
</Column>
<Column border="neutral-alpha-medium" padding="16" radius="m">
<Text>Grid Item</Text>
</Column>
<Column border="neutral-alpha-medium" padding="16" radius="m">
<Text>Grid Item</Text>
</Column>
</Grid>
Media
SmartImage

<SmartImage
src="/images/projects/project-01/cover-01.jpg"
sizes="640px"
alt="Example image"
aspectRatio="16/9"
radius="l"
/>
SmartImage
<SmartImage
src="https://www.youtube.com/watch?v=TQT_FSdxbC8"
alt="Example video"
aspectRatio="16/9"
radius="l"
/>
Link
Custom components
src/product/mdx.tsx
const components = {
// Add new components
p: createParagraph as any,
h1: createHeading("h1") as any,
...
SmartImage: dynamic(() => import("@/once-ui/components").then(mod => mod.SmartImage)),
SmartLink: dynamic(() => import("@/once-ui/components").then(mod => mod.SmartLink)),
};