- Prop
class- Type
string- Default
- —
- Requirement
- optional
Docs Components Navigation
Kbd
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
const kbdFixture = { id: "kbd", keys: ["⌘", "K"],} satisfies { id: string; keys: string[] }; import { Kbd } from "@grassroot/ui-react"; export default function KbdDemo() { return ( <div> {kbdFixture.keys.map((key) => ( <Kbd key={key}>{key}</Kbd> ))} </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">import { Kbd } from "@grassroot/ui-vue";const kbdFixture = { id: "kbd", keys: ["⌘", "K"],} satisfies { id: string; keys: string[] }; </script> <template> <div> <Kbd v-for="key in kbdFixture.keys" :key="key">{{ key }}</Kbd> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";import { GrassrootKbd } from "@grassroot/ui-angular";const kbdFixture = { id: "kbd", keys: ["⌘", "K"],} satisfies { id: string; keys: string[] }; @Component({ selector: "app-kbd-demo", standalone: true, imports: [GrassrootKbd], template: ` <div> @for (key of fixture.keys; track key) { <grassroot-kbd>{{ key }}</grassroot-kbd> } </div> `,})export class KbdDemoComponent { protected readonly fixture = kbdFixture;} export default KbdDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> import { Kbd } from "@grassroot/ui-svelte"; const kbdFixture = { id: "kbd", keys: ["⌘", "K"], } satisfies { id: string; keys: string[] }; </script> <div> {#each kbdFixture.keys as key (key)}<Kbd>{key}</Kbd>{/each}</div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */import { Kbd } from "@grassroot/ui-solid";const kbdFixture = { id: "kbd", keys: ["⌘", "K"],} satisfies { id: string; keys: string[] }; export default function KbdDemo() { return ( <div> {kbdFixture.keys.map((key) => ( <Kbd>{key}</Kbd> ))} </div> );}Installation
API Reference
Import
import { Kbd } from "@grassroot/ui-react";
Content regions
children
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.
Import
import { Kbd } from "@grassroot/ui-vue";
Content regions
default
Import
import { Component } from "@angular/core";
import { GrassrootKbd } from "@grassroot/ui-angular";
Content regions
default
Import
import { Kbd } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
classstring—
optional
Content regions
children
Import
import { Kbd } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
classNamestring—
optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Content regions
children
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.