Live preview

Interactive example

Loading example…

Usage

Import the component, then make it your own.

ComponentLabeledItem

svelte

<script>
  // Import the shared stylesheet once in your application's root layout.
  import "sveltekit-ui/style.css"
  import { LabeledItem, TextInput, create_text_input_manager } from "sveltekit-ui"

  const name_input = create_text_input_manager({ label: "Display name", val: "Alex" })
</script>

<LabeledItem label="Profile" tooltip="This name appears on your public profile.">
  <TextInput manager={name_input} />
</LabeledItem>

API reference

Props accepted by the component.

16 entries in properties

PropertyTypeDefaultDescription
labelstring labelThe text label displayed next to the content.
tooltipstring or null nullOptional tooltip text displayed when hovering over the tooltip icon.
is_requiredboolean falseIndicates whether the labeled item is required.
is_disabledboolean falseIndicates whether the content is disabled.
font_weightnumber 500The font weight of the label text.
font_sizenumber 1.6The font size of the label text in rem.
colorCSS color var(--g4-t)The color of the label text.
disabled_colorCSS color var(--g8-t)The color of the label text when disabled.
mlnumber 0Margin-left in rem.
mrnumber 0Margin-right in rem.
mtnumber 0Margin-top in rem.
mbnumber 0Margin-bottom in rem.
heading_min_widthnumber 20Minimum width of the label heading in rem.
content_min_widthnumber 30Minimum width of the content area in rem.
content_max_widthnumber 50Maximum width of the content area in rem.
childrensnippet nullThe content to be displayed alongside the label.