Skip to content

Label

A native, styled label element.


---
import { Label } from 'fulldev-ui'
---
<Label>Label</Label>

Props

size

Type: size?: 'sm' | 'md' | 'lg'

Sets the size for this component and all its children.

---
import { Label } from 'fulldev-ui'
---
<Label size="sm">Label</Label>
<Label size="md">Label</Label>
<Label size="lg">Label</Label>

density

Type: density?: 'base' | 'compact' | string

Changes the underlying values used by the size prop, for this component and all its children.

For example, we set compact on a card and can now size this and all children automatically based on the size on the wrapping block/section.

Choose a predefined density, or a custom value defined like explained in the theming guide.

---
import { Label } from 'fulldev-ui'
---
<Label density="compact" size="sm">Label</Label>
<Label density="compact" size="md">Label</Label>
<Label density="compact" size="lg">Label</Label>

variant

Type: color?: 'base' | 'muted'

Sets the color variant used for this component and all its children.

---
import { Label } from 'fulldev-ui'
---
<Label variant="base">Label</Label>
<Label variant="muted">Label</Label>

theme

Type: theme?: 'light' | 'dark' | string

Changes the colors for this component and all its children.

Choose a predefined theme, or a custom value defined like explained in the theming guide.

text

Type: text?: string

Useful when getting content from Astro content collections or a headless CMS.

html

Type: html?: string

Similar to text prop, but renders HTML. Use this for for <span>, <br>, etc.

as & HTML Attributes

Type: as?: HTMLTag = 'label'

Used to determine which HTML tag is used to render the component.

Based on the value, all HTML attributes of this tag are accepted as props too.

For a detailed explanation see Polymorphic props in the Astro documentation.