Tag

Updated at:

Introduction

The tag component is a basic Mobi component used for marking and categorization.

Configuration items

Category

Configuration

Example

Description

Content

Tag name

image

The text content of the tag.

Icon

image

The icon that precedes the tag.

Interaction

Hide

image

Hides the component. For more information, see Common properties.

Keep layout when hidden

image

Keeps the layout space when the component is hidden. For more information, see Common properties.

Selectable

image

Tags can be selected.

Selected by default

image

This option is selected by default.

Style

Margin

image

The outer margin. For more information, see Common properties.

Layout

image

The position of the tag in the container.

Theme

image

The theme color of the tag. Options include the following: Success, Processing, Error, Warning, Default, Magenta, Red, Volcano, Orange, Gold, Lime, Green, Cyan, Blue, Geek Blue, and Purple.

Show border

image

Specifies whether to show the border.

Customize the subject?

image

Specifies whether to use a custom theme.

Custom theme color

image

The custom theme color.

CSS style

Font size

image

The font size of the tag text.

Content color

image

The color of the tag text.

Border radius

image

The border radius. For more information, see Common properties.

Border

image

The border. For more information, see Common properties.

Top border

image

The top border. For more information, see Common properties.

Right border

image

The right border. For more information, see Common properties.

Bottom border

image

The bottom border. For more information, see Common properties.

Left border

image

The left border. For more information, see Common properties.

Properties and methods

Name

Type

Example

Description

name

string

tag.name

The current name of the tag.

theme

string

tag.theme

Read-only. The current theme of the tag.

checked

boolean

tag.checked

The selected state.

setName

func

tag.setName('tag')

Sets the current name of the tag.

setChecked

func

tag.setChecked(true)

Sets the selected state.

Event callbacks

Configuration

Description

image

The callback that is triggered when the selected state changes.