nb-gradient-text
This is a gradient text component for Vue.js 3+.
Installation
Yarn
yarn add @vlalg-nimbus/nb-text
Usage
Vue 3
import { createApp } from 'vue'
import App from './App.vue'
import NbTextComponents from '@vlalg-nimbus/nb-text'
import "@vlalg-nimbus/nb-text/dist/style.css";
const app = createApp(App)
app.use(NbTextComponents)
app.mount('#app')
To use, simply call the component, in this case it will be NbGradientText
or nb-gradient-text
.
Mode 1
<template>
<NbGradientText />
</template>
Preview & Playground
Select the component you want to edit/test
Loading Sandbox...
Props
Items with an (*) mean they are required
name | Value type | Default | Description |
---|---|---|---|
nbId (*) | String | Sets the id attribute to differentiate from other components | |
lineHeight | String | '1.42857143' | Defines text line-height, accepts any value greater than 0 |
size | String | '3rem' | Defines text size, accepts any value + type (px, em or ...) |
bgFirst | String | '#5639fc' | Defines the first gradient background color. Accepts Color name and Hex |
bgSecond | String | '#05f7ff' | Defines the second gradient background color. Accepts Color name and Hex |
alignment | String | 'left' | Defines the text align. Accepts center, left and left. For this property to work, the component needs to have the size property high and in a container of size X or the text to be large and also being in a container of size X. There are several ways for this property to work, all involving the size of the container this component is included in. |
paddingBottom | String | '5' | Defines text padding-bottom. Depending on the font size (size prop) and if the last paragraph has a letter with a long leg, the leg of the letter will have a hidden part. This property allows to fix this. The minimum value is 5 |
fontFamily | String | "'Lato', sans-serif" | Defines the font-family |
fontSize | String | '1.6em' | Defines the font-size |
fontWeight | Number | 400 | Defines the font-weight |
Slot
The component has a slot called text
where the content that will be manipulated must be passed. It has a default text (Default Text
) in case the content does not pass through the slot.
<template>
<NbGradientText>
<template #text>
CONTENT HERE
</template>
</NbGradientText>
</template>
Table of Contents