Snippet

Display a snippet of copyable code for the command line.

General

Basic Usage

Preview
See code
yarn add @bolio-ui/core

Width

Specify width manually.

Preview
See code
yarn add @bolio-ui/core

Types

Show different states with colors.

Preview
See code
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core

Rounded

You can completely round the corners of any type of Snippet with the rounded property.

Preview
See code
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core

Multi Line

You can use multi line of the Snippet with the array in text prop.

Preview
See code
cd project
now

Without Copy

Hide icon for copy. (disable copy)

Preview
See code
yarn add @bolio-ui/core

Custom Symbol

You can custom symbol of the Snippet with the property symbol.

Preview
See code
yarn add @bolio-ui/core

Custom Toast

You can custom toast of the Snippet with the property toastText and toastType.

Preview
See code
yarn add @bolio-ui/core

Filled

Show different states filled with colors.

Preview
See code
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core
yarn add @bolio-ui/core

APIs

Snippet.Props

AttributeDescriptionTypeAccepted valuesDefault
textcode snippetstring string[]--
typesnippet typesSnippetTypesSnippetTypesdefault
filledfilled styleboolean-false
widthset CSS stringstring-initial
copyfunction of copy buttonCopyTypesCopyTypesdefault
symbolsymbol snippetstring-$
toastTexttoast textstring-Copied to clipboard!
toastTypetoast typeToastTypesToastTypessuccess
...native propsHTMLAttributes'id', 'name', 'className', ...-

SnippetTypes

type SnippetTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'

CopyTypes

type CopyTypes = 'default' | 'silent' | 'prevent'

ToastTypes

type ToastTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'
Edit this page on GitHub

Previous

Slider

Next

Spacer

MADE & DESIGNED WITHBY BRUNO ANDRADE
docs background gradient blue
docs background gradient violet