BlogPlaygroundOne

Borders

Utilities for controlling the border of elements in your application.

Edit this page
Report a Bug
Copy Page as Markdown
ClassProperties
borderborder: thin solid rgba(var(–v-border-color), var(–v-border-opacity));
border-thinborder-width: thin;
border-smborder-width: 1px;
border-mdborder-width: 2px;
border-lgborder-width: 4px;
border-xlborder-width: 8px;
border-0border-width: 0;
border-tborder-top-width: thin;
border-t-0border-top-width: 0;
border-t-thinborder-top-width: thin;
border-t-smborder-top-width: 1px;
border-t-mdborder-top-width: 2px;
border-t-lgborder-top-width: 4px;
border-t-xlborder-top-width: 8px;
border-eborder-inline-end-width: thin;
border-e-0border-inline-end-width: 0;
border-e-thinborder-inline-end-width: thin;
border-e-smborder-inline-end-width: 1px;
border-e-mdborder-inline-end-width: 2px;
border-e-lgborder-inline-end-width: 4px;
border-e-xlborder-inline-end-width: 8px;
border-bborder-bottom-width: thin;
border-b-0border-bottom-width: 0;
border-b-thinborder-bottom-width: thin;
border-b-smborder-bottom-width: 1px;
border-b-mdborder-bottom-width: 2px;
border-b-lgborder-bottom-width: 4px;
border-b-xlborder-bottom-width: 8px;
border-sborder-inline-start-width: thin;
border-s-0border-inline-start-width: 0;
border-s-thinborder-inline-start-width: thin;
border-s-smborder-inline-start-width: 1px;
border-s-mdborder-inline-start-width: 2px;
border-s-lgborder-inline-start-width: 4px;
border-s-xlborder-inline-start-width: 8px;
border-opacity-0–v-border-opacity: 0;
border-opacity–v-border-opacity: .12;
border-opacity-25–v-border-opacity: .25;
border-opacity-50–v-border-opacity: .5;
border-opacity-75–v-border-opacity: .75;
border-opacity-100–v-border-opacity: 1;
border-dashedborder-style: dashed;
border-dottedborder-style: dotted;
border-doubleborder-style: double;
border-solidborder-style: solid;

Usage

The border utilities allow you to quickly style the border of any element.

All sides

Use the border, border-0, border-sm, border-md, border-lg, and border-xl classes to set the border width of an element.

border-thin
border-sm
border-md
border-lg
border-xl

Individual sides

Use the border-*, border-*-0, border-*-sm, border-*-md, border-*-lg, and border-*-xl classes to set the border width of an element on a specific side.

border-t-lg
border-e-lg
border-b-lg
border-s-lg

Border styles

Use the border-dashed, border-dotted, border-double, and border-solid classes to set the border style of an element.

border
border-dashed
border-dotted
border-double

Theme colors

Components that support the border property can take advantage of all border utility classes. This includes colors generated by your theme.

"primary thin"
"success sm"
"info md"
"warning lg"
"error xl"
ClassProperties
border-primary–v-border-color: var(–v-theme-primary);
border-secondary–v-border-color: var(–v-theme-secondary);
border-accent–v-border-color: var(–v-theme-accent);
border-error–v-border-color: var(–v-theme-error);
border-info–v-border-color: var(–v-theme-info);
border-success–v-border-color: var(–v-theme-success);
border-warning–v-border-color: var(–v-theme-warning);
border-surface–v-border-color: var(–v-theme-surface);
border-background–v-border-color: var(–v-theme-background);
border-surface-light–v-border-color: var(–v-theme-surface-light);
border-surface-variant–v-border-color: var(–v-theme-surface-variant);
border-surface-bright–v-border-color: var(–v-theme-surface-bright);
border-current–v-border-color: currentColor;

Components

Setting the border property to true applies a component specific border class, such as v-card--border. This is to ensure that basic border usage persists even if the utility classes are disabled.

Revenue
13%
$ 9,232,215
+ $ 3,295
in the last week

SASS variables

You can also use the following SASS variables to customize the border color and width:

src/styles/settings.scss
@use 'vuetify/settings' with (
  $borders: (
    0: 0,
    null: thin,
    thin: thin,
    sm: 1px,
    md: 2px,
    lg: 4px,
    xl: 8px
  )
);

Disable border class generation by setting the $borders variable to false.

src/styles/settings.scss
@use 'vuetify/settings' with (
  $borders: false
);

Ready for more?

Continue your learning with related content selected by the Team or move between pages by using the navigation links below.