UNPKG

@dvcol/neo-svelte

Version:

Neomorphic ui library for svelte 5

49 lines (48 loc) 1.41 kB
import type { Snippet } from 'svelte'; import type { NeoPillProps } from '../pill/neo-pill.model.js'; import type { HTMLNeoBaseElement, HTMLTagProps } from '../utils/html-element.utils.js'; export declare const NeoBadgePlacement: { readonly Top: "top"; readonly TopRight: "top-right"; readonly TopLeft: "top-left"; readonly Bottom: "bottom"; readonly BottomRight: "bottom-right"; readonly BottomLeft: "bottom-left"; readonly Right: "right"; readonly Left: "left"; }; export type NeoBadgePlacements = (typeof NeoBadgePlacement)[keyof typeof NeoBadgePlacement]; export interface NeoBadgeContext { placement: NeoBadgePlacements; offset?: { x?: string; y?: string; }; } export type NeoBadgeProps = { /** * The content to place the badge on. */ children?: Snippet<[NeoBadgeContext]>; /** * The value to display in the badge. */ value?: string | Snippet<[NeoBadgeContext]>; /** * Optional vertical and horizontal offset for the badge. */ offset?: number | string | { x?: number | string; y?: number | string; }; /** * Badge placement relative to the content. * * @default top-right */ placement?: NeoBadgePlacements; /** * Props to pass to the relative container. */ containerProps?: HTMLNeoBaseElement & HTMLTagProps; } & NeoPillProps;