Skip to main content

namespace shadcn

Namespaces​

Records​

Functions​

button_metrics​

ButtonMetrics button_metrics(ButtonSize size)

Source

install​

void install(QApplication & app, Theme theme, MotionPolicy motion, int fontPixels)

Install the theme and bundled Geist font on the application's GUI thread. Passing zero or a negative fontPixels preserves the application's current font size.

make_child​

T & make_child(QWidget & parent, Args &&... args)

Source

rowData​

QVariant rowData(const QModelIndex & index, RowRole role)

to_srgb​

std::expected<Rgba, ValueError> to_srgb(Oklch color)

Convert OKLCH to sRGB and clip channels outside the gamut. CSS gamut mapping is not implemented.

progress_fraction​

std::expected<double, ValueError> progress_fraction(double value, double minimum, double maximum)

Reject NaN, infinity, reversed ranges and values outside the range.

transition_easing​

double transition_easing(double progress)

Tailwind's default transition curve, cubic-bezier(0.4, 0, 0.2, 1).

pulse_opacity​

double pulse_opacity(double seconds)

Tailwind pulse opacity. One cycle is 2 seconds, with opacity 0.5 halfway.

Enums​

Side​

Values:

  • Top
  • Right
  • Bottom
  • Left

Source

Variant​

Values:

  • Default
  • Destructive
  • Outline
  • Secondary
  • Ghost
  • Link

Source

Button appearances.

ButtonSize​

Values:

  • Default
  • Xs
  • Sm
  • Lg
  • Icon
  • IconXs
  • IconSm
  • IconLg

Source

Button sizes, including all four sizes for icons.

ColorMode​

Values:

  • Light
  • Dark

Source

MotionPolicy​

Values:

  • Full
  • Reduced

Source

RowRole​

Values:

  • Description
  • Leading
  • Trailing
  • TrailingText
  • Progress
  • Heading

Source

The data a themed view reads for one row.

A caller supplies data, not widgets, so a large set costs only the rows on screen. The title comes from Qt::DisplayRole, so a model that fills nothing else still produces a readable row.

ToggleVariant​

Values:

  • Default
  • Outline

Source

ToggleSize​

Values:

  • Default
  • Sm
  • Lg

Source

ToggleGroupMode​

Values:

  • Single
  • Multiple

Source

ToastType​

Values:

  • Default
  • Success
  • Info
  • Warning
  • Error
  • Loading

Source

AlertVariant​

Values:

  • Default
  • Destructive

Source

ToastPosition​

Values:

  • Top
  • TopRight
  • TopLeft
  • Bottom
  • BottomRight
  • BottomLeft

Source

AvatarSize​

Values:

  • Default
  • Sm
  • Lg

Source

InputGroupAlign​

Values:

  • InlineStart
  • InlineEnd
  • BlockStart
  • BlockEnd

Source

InputGroupButtonSize​

Values:

  • Xs
  • Sm
  • IconXs
  • IconSm

Source

Direction​

Values:

  • LeftToRight
  • RightToLeft

Source

Direction context translated to Qt's layout direction.

ItemVariant​

Values:

  • Default
  • Outline
  • Muted

Source

ItemSize​

Values:

  • Default
  • Sm
  • Xs

Source

ItemMediaVariant​

Values:

  • Default
  • Icon
  • Image

Source

ValueError​

Values:

  • NonFinite
  • OutOfRange
  • EmptyRange

Source

Role​

Values:

  • Background
  • Foreground
  • Card
  • CardForeground
  • Popover
  • PopoverForeground
  • Primary
  • PrimaryForeground
  • Secondary
  • SecondaryForeground
  • Muted
  • MutedForeground
  • Accent
  • AccentForeground
  • Destructive
  • Border
  • Input
  • Ring
  • Chart1
  • Chart2
  • Chart3
  • Chart4
  • Chart5
  • Sidebar
  • SidebarForeground
  • SidebarPrimary
  • SidebarPrimaryForeground
  • SidebarAccent
  • SidebarAccentForeground
  • SidebarBorder
  • SidebarRing
  • Count

Source

Semantic roles from shadcn's neutral theme, including chart and sidebar roles.

AttachmentState​

Values:

  • Idle
  • Uploading
  • Processing
  • Error
  • Done

Source

TabsListVariant​

Values:

  • Default
  • Line

Source

AttachmentSize​

Values:

  • Default
  • Sm
  • Xs

Source

AttachmentOrientation​

Values:

  • Horizontal
  • Vertical

Source

SwitchSize​

Values:

  • Default
  • Sm

Source

BubbleVariant​

Values:

  • Default
  • Secondary
  • Muted
  • Tinted
  • Outline
  • Ghost
  • Destructive

Source

BubbleAlign​

Values:

  • Start
  • End

Source

SidebarSide​

Values:

  • Left
  • Right

Source

SidebarCollapsible​

Values:

  • None
  • Offcanvas
  • Icon

Source

SidebarVariant​

Values:

  • Sidebar
  • Floating
  • Inset

Source

SidebarMenuSize​

Values:

  • Default
  • Sm
  • Lg

Source

SidebarMenuVariant​

Values:

  • Default
  • Outline

Source

MessageAlign​

Values:

  • Start
  • End

Source

ChartType​

Values:

  • Line
  • Area
  • Bar
  • Pie

Source

QuestionnaireType​

Values:

  • Single
  • Multiple

Source

MarkerVariant​

Values:

  • Default
  • Separator
  • Border

Source