Skip to main content

Button

The ty-button component is a fundamental building block in user interfaces, enabling users to interact with and trigger various actions and events.

Usage

You can use the ty-button component in your HTML code as follows:

Live Editor
<ty-button corner="sm" size="sm">
  <span class="material-icons md-18">start</span>
  Fill Button
</ty-button>
Result
Loading...

Filled Button

The filled variant of ty-button creates a solid, visually distinct button:

startFill Button
<ty-button variant="outlined">
<span class="material-icons md-18">start</span>
Fill Button
</ty-button>

Outlined Button

The outlined variant of ty-button provides a button with an outlined border:

startFill Button
<ty-button variant="outlined">
<span class="material-icons md-18">start</span>
Fill Button
</ty-button>

Icon Button

The icon variant of ty-button allows you to create button icons without text:

start
<ty-button variant="outlined">
<span class="material-icons md-18">start</span>
</ty-button>

API

The ty-button component accepts the following properties:

Properties

NameDescriptionTypeDefault
variantbutton type'filled', 'outlined', 'text', 'icon''filled'
colorbutton color'neutral' ,'primary''primary'
sizesize'sm', 'md''md'
disableddisable the button'boolean''false'
cornerborder radius'none', 'xs', 'sm', 'md', 'lg''none'

Events

NameDescription
'ty-click'Emit event when the button is clicked