Skip to content

Reference

[09] Reference

Tailwind CSS Classes to VaneUI Props

Look up the VaneUI boolean prop for a Tailwind CSS class: layout, flex alignment, spacing, typography, borders, shadows, colors and responsive variants.

Edit this page

Most Tailwind CSS utility classes that style a VaneUI component have a boolean prop named after the class in camelCase: items-center is itemsCenter, font-semibold is fontSemibold, flex-1 is flex1. A few take a shorter name, such as pill for rounded-full. The tables below map each class to its prop, grouped by category, for @vaneui/ui 1.7.2. A prop works on the components that include its category; each component page lists its props, and Common Props describes the shared layout props.

Rows marked size-driven have no fixed value of their own. Gap, padding, margin, border radius, shadow and font size come from the component's size prop, xs to xl, so <Card lg> enlarges its padding, gap and radius together. To change one of those amounts, change the size prop rather than add a class. Core Concepts explains the size system.

A row of badges that stacks on phones, written with classes and then with props:

// Classes
<div className="flex flex-col md:flex-row items-stretch gap-6">
<span className="rounded-full border px-2 font-semibold uppercase">Active</span>
</div>
// Props: Badge is already a pill and semibold
<Row mobileStack itemsStretch lg>
<Badge uppercase>Active</Badge>
</Row>

Leave out the props that are already defaults. Row is flex, row and itemsCenter from the start, and Badge is pill, fontSemibold and sm, so writing them again changes nothing.

Layout: display, direction, position and overflow

Tailwind CSS classVaneUI prop
blockblock
inlineinline
inline-blockinlineBlock
flexflex
inline-flexinlineFlex
gridgrid
inline-gridinlineGrid
contentscontents
tabletable
table-celltableCell
hiddenhidden
flex-rowrow
flex-colcolumn
flex-row-reverserowReverse
flex-col-reversecolumnReverse
relativerelative
absoluteabsolute
fixedfixed
sticky top-0sticky
staticstatic

Row is a flex row by default, and Col, Stack, Card and Section are flex columns, so flex, row and column rarely need writing. sticky also sets top to the --sticky-top variable, 0 unless you set it, which leaves room for a fixed header.

Tailwind CSS classVaneUI prop
overflow-autooverflowAuto
overflow-hiddenoverflowHidden
overflow-clipoverflowClip
overflow-visibleoverflowVisible
overflow-scrolloverflowScroll
overflow-x-autooverflowXAuto
overflow-x-hiddenoverflowXHidden
overflow-x-clipoverflowXClip
overflow-x-visibleoverflowXVisible
overflow-x-scrolloverflowXScroll
overflow-y-autooverflowYAuto
overflow-y-hiddenoverflowYHidden
overflow-y-clipoverflowYClip
overflow-y-visibleoverflowYVisible
overflow-y-scrolloverflowYScroll

Flex and grid alignment

Tailwind CSS classVaneUI prop
items-startitemsStart
items-enditemsEnd
items-centeritemsCenter
items-baselineitemsBaseline
items-stretchitemsStretch
justify-startjustifyStart
justify-endjustifyEnd
justify-centerjustifyCenter
justify-betweenjustifyBetween
justify-aroundjustifyAround
justify-evenlyjustifyEvenly
justify-stretchjustifyStretch
justify-baselinejustifyBaseline
self-autoalignSelfAuto
self-startalignSelfStart
self-endalignSelfEnd
self-centeralignSelfCenter
self-stretchalignSelfStretch
self-baselinealignSelfBaseline
justify-self-autojustifySelfAuto
justify-self-startjustifySelfStart
justify-self-endjustifySelfEnd
justify-self-centerjustifySelfCenter
justify-self-stretchjustifySelfStretch
flex-wrapflexWrap
flex-nowrapflexNoWrap
flex-wrap-reverseflexWrapReverse
flex-1flex1
flex-autoflexAuto
flex-noneflexNone
shrink-0noShrink

Row centers its children on the cross axis by default, and Section aligns them to the start. itemsStretch makes the children of either fill it. The alignSelf* and justifySelf* props exist only on Popup, Tooltip and the Checkbox, Radio and Switch controls; on a Card or Col, self-* stays in className.

Spacing: gap, padding and margin

Tailwind CSS classVaneUI propNotes
gap-*gapSize-driven, on by default in layout components
gap-0noGap
p-*paddingSize-driven
px-*paddingXSize-driven
py-*paddingYSize-driven
p-0noPaddingDefault on Row, Col, Grid and Container
m-*marginSize-driven, equal to the component's gap
mx-*marginXSize-driven
my-*marginYSize-driven
mt-*marginTSize-driven
mb-*marginBSize-driven
m-0noMarginDefault on Text and the title components

On Row, Col and Grid the size prop lands on Tailwind's spacing scale, so a gap class converts to a size:

Tailwind CSS classRow, Col or Grid prop
gap-2 (8px)xs
gap-3 (12px)sm
gap-4 (16px)none: md is the default
gap-6 (24px)lg
gap-8 (32px)xl

Section, Card, Stack and Container set their own padding and gap for each size and step them down on tablets and phones. A gap-4 or p-6 class in className overrides the size-driven value at every width, which also turns that step-down off.

Width and height

Tailwind CSS classVaneUI prop
w-fullwFull
w-fitwFit
w-autowAuto
w-screen max-w-nonewScreen
h-fullhFull
h-fithFit
h-autohAuto
h-screen max-h-nonehScreen

Button, Badge and Text are wFit; Input, NavLink, Section and Container are wFull.

Typography: size, weight, case and wrapping

Font size from the size prop

Font size is size-driven: there is no font size prop apart from the size props. On Text they match Tailwind's text scale:

Tailwind CSS classText prop
text-xs (12px)xs
text-sm (14px)sm
text-base (16px)none: md is the default
text-lg (18px)lg
text-xl (20px)xl

The titles, Button, Badge and the other components keep their own scales, and on Button or Card the size prop also moves the padding, gap and radius.

Font weight and family

Tailwind CSS classVaneUI prop
font-thinfontThin
font-extralightfontExtralight
font-lightfontLight
font-normalfontNormal
font-mediumfontMedium
font-semiboldfontSemibold
font-boldfontBold
font-extraboldfontExtrabold
font-blackfontBlack
font-sansfontSans
font-seriffontSerif
font-monofontMono
font-headingfontHeading
italicitalic
not-italicnotItalic

font-heading is not a Tailwind CSS default class: it uses the heading font from VaneUI's theme, which the title components use by default.

Decoration, case and alignment

Tailwind CSS classVaneUI prop
underlineunderline
line-throughlineThrough
no-underlinenoUnderline
overlineoverline
uppercaseuppercase
lowercaselowercase
capitalizecapitalize
normal-casenormalCase
text-lefttextLeft
text-centertextCenter
text-righttextRight
text-justifytextJustify
text-starttextStart
text-endtextEnd

textStart and textEnd follow the reading direction and flip under dir="rtl"; textLeft and textRight never flip. Text and the title components are textLeft by default, so textCenter on a parent does not center their lines: put it on the Text itself.

Truncation, letter spacing and wrapping

Tailwind CSS classVaneUI prop
truncatetruncate
line-clamp-2lineClamp2
line-clamp-3lineClamp3
line-clamp-4lineClamp4
line-clamp-5lineClamp5
line-clamp-nonenoTruncate
tracking-tightertrackingTighter
tracking-tighttrackingTight
tracking-normaltrackingNormal
tracking-widetrackingWide
tracking-widertrackingWider
tracking-widesttrackingWidest
whitespace-normalwhitespaceNormal
whitespace-nowrapwhitespaceNowrap
whitespace-prewhitespacePre
whitespace-pre-wrapwhitespacePreWrap
whitespace-pre-linewhitespacePreLine
whitespace-break-spaceswhitespaceBreakSpaces
break-normalbreakNormal
break-wordsbreakWords
break-allbreakAll
break-keepbreakKeep

The letter spacing props are on Text, the title components, Link and Blockquote. Truncation and word breaking also reach List, ListItem and several form parts.

List markers

Tailwind CSS classVaneUI prop
list-disclistDisc
list-decimallistDecimal
list-[circle]listCircle
list-[square]listSquare
list-[lower-alpha]listLowerAlpha
list-[lower-roman]listLowerRoman
list-insidelistInside
list-outsidelistOutside

Borders and border radius

Tailwind CSS classVaneUI propNotes
borderborderWidth from the --bw variable, color from the appearance
border-tborderT
border-bborderB
border-lborderL
border-rborderR
border-xborderX
border-yborderY
border-sborderStartFlips under dir="rtl"
border-eborderEndFlips under dir="rtl"
border-0noBorder
rounded-*roundedSize-driven, the default shape
rounded-fullpill
rounded-nonesharp

Side props combine: borderT borderB draws both lines, and noBorder removes every side. A border color class has no prop; strongBorder switches to the stronger border color of the component's appearance.

Shadows, rings and focus outlines

Tailwind CSS classVaneUI propNotes
shadow-*shadowSize-driven
shadow-xs to shadow-xlshadowXs, shadowSm, shadowMd, shadowLg, shadowXlA fixed step of VaneUI's shadow scale, whatever the size
shadow-nonenoShadow
ring-1 ring-insetinsetRingWidth from the --rw variable
ring-0noInsetRing
focus-visible:outline-2 focus-visible:outline-offset-2focusVisibleDefault on Button, Input, Link and the other controls
nonenoFocusVisibleLeaves out the outline classes of focusVisible

Colors and appearance

No prop sets a single background, text or border color. One appearance prop picks the color family, one variant prop picks how it is applied, and both switch with dark mode:

Tailwind CSS classesVaneUI props
A solid bg-* with light text-* and a darker hover:bg-*filled plus an appearance
A light bg-* with colored text-* and border-*an appearance alone: outline is the default variant
Colored text-* on bg-transparent, tinted on hoverghost plus an appearance
bg-transparenttransparent
text-inheritinheritAppearance, the default on typography
Color familyAppearance prop
Gray, the neutral defaultprimary
Light gray, subtlesecondary
Darker gray, mutedtertiary
Rose, highlightaccent
Green, positivesuccess
Red, error or destructivedanger
Amber, cautionwarning
Cyan, informationalinfo

So bg-red-600 text-white on a button becomes <Button danger filled>. A dark: class has no prop and needs none: the color tokens change when <html data-theme="dark"> is set, as the Dark Mode page describes.

Responsive variants

VaneUI's mobile, tablet and desktop breakpoints sit at 48rem, 64rem and 80rem, the same widths as Tailwind's md, lg and xl. The props are desktop-first, so each one matches a max-* class:

Tailwind CSS classesVaneUI prop
max-md:flex-col, or flex-col md:flex-rowmobileStack
max-lg:flex-col, or flex-col lg:flex-rowtabletStack
max-xl:flex-col, or flex-col xl:flex-rowdesktopStack
max-md:hiddenmobileHide
max-lg:hiddentabletHide
max-xl:hiddendesktopHide
md:hiddenmobileShow
lg:hiddentabletShow
xl:hiddendesktopShow
max-md:w-fullmobileWFull
max-lg:w-fulltabletWFull
max-xl:w-fulldesktopWFull
grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3Grid3, with no prop
p-4 md:p-6 lg:p-12 gap-4 md:gap-6 lg:gap-8Section, with no prop

The stack props only change row-direction components, which in practice means Row. A Tailwind CSS v4 build needs @import "@vaneui/ui/tokens" for these props to emit any CSS, as the Installation page shows. Responsive Page Sections Without Breakpoint Classes builds a full section with them.

Cursor, pointer events, images and motion

Tailwind CSS classVaneUI prop
cursor-pointercursorPointer
cursor-defaultcursorDefault
cursor-not-allowedcursorNotAllowed
cursor-nonecursorNone
cursor-textcursorText
cursor-movecursorMove
cursor-waitcursorWait
pointer-events-nonepointerEventsNone
pointer-events-autopointerEventsAuto
object-coverobjectCover
object-containobjectContain
object-fillobjectFill
object-noneobjectNone
object-scale-downobjectScaleDown
transitiontransition, with duration and easing from theme variables
transition-nonenoTransition
backdrop-blur-*backdropBlur, with the amount from --overlay-blur
h-px w-full on a ruleDivider, horizontal by default
w-px h-full on a rulevertical on Divider

The cursor props are on Button, Badge, Card, the typography components and the form controls, not on Row, Col or Stack. The transition props are on the controls, object* on Img and backdropBlur on Overlay.

Classes with no prop

These stay in className:

  • Widths and heights other than full, fit, auto and screen: w-64, max-w-3xl, min-h-screen, size-8.
  • Offsets and stacking order: top-4, inset-0, z-10.
  • Grid placement: col-span-2, grid-cols-[200px_1fr].
  • Margins on the inline sides, or an exact amount: ml-4, me-2, mt-[13px].
  • Gradients, opacity, aspect-* and sr-only.
  • hover: and focus: styles beyond the states a component already has.

A class you add wins over the theme's class for the same property. The prebuilt @vaneui/ui/css stylesheet contains only the utilities VaneUI's own components use, so most of these classes work only in a project with its own Tailwind CSS v4 build; without one, use the style prop.