mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(stack): add Stack
component (#1963)
This commit is contained in:
parent
a7d3cffc2a
commit
0f1a77a3fc
10 changed files with 470 additions and 2 deletions
36
types/Stack/Stack.svelte.d.ts
vendored
Normal file
36
types/Stack/Stack.svelte.d.ts
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
import type { SvelteComponentTyped } from "svelte";
|
||||
import type { SvelteHTMLElements } from "svelte/elements";
|
||||
|
||||
export type StackScale = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
||||
|
||||
type RestProps = SvelteHTMLElements["svelte:element"];
|
||||
|
||||
export interface StackProps extends RestProps {
|
||||
/**
|
||||
* Specify the gap between items in the stack.
|
||||
* The scale maps to Carbon layout values.
|
||||
* Alternatively, specify a custom value (e.g., "200px").
|
||||
* @default 1
|
||||
*/
|
||||
gap?: StackScale | string;
|
||||
|
||||
/**
|
||||
* Specify the orientation of the stack.
|
||||
* @default "vertical"
|
||||
*/
|
||||
orientation?: "vertical" | "horizontal";
|
||||
|
||||
/**
|
||||
* Specify the tag name
|
||||
* @default "div"
|
||||
*/
|
||||
tag?: keyof HTMLElementTagNameMap;
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
}
|
||||
|
||||
export default class Stack extends SvelteComponentTyped<
|
||||
StackProps,
|
||||
Record<string, any>,
|
||||
{ default: {} }
|
||||
> {}
|
Loading…
Add table
Add a link
Reference in a new issue