HomeDocs
Skip to main content

Basic Components

The framework provides developers with a range of basic components that can be combined to quickly develop applications. For detailed information, please refer to the component documentation.

What are components:

  • Components are the basic building blocks of the view layer.
  • Components come with some styles consistent with the TransVoice style.
  • A component typically consists of an opening tag and a closing tag, with attributes used to modify the component and content enclosed between the two tags.
<tagname property="value"> Content goes here ... </tagname>

Note: All components and attributes are in lowercase and connected with hyphens (-)

Attribute Types

TypeDescriptionNotes
BooleanBoolean valueWhen this attribute is present on a component, it's treated as true regardless of its value. It's considered false only when it's not present on the component. If the attribute value is a variable, its value will be converted to a Boolean.
NumberNumber1, 2.5
StringString"string"
ArrayArray[1, "string"]
ObjectObject{ key: value }
EventHandlerEvent handler"handlerName" is the name of an event handler defined in the Page.
AnyAnyAny attribute

Common Properties

All components have the following properties:

PropertyTypeDescriptionNotes
idStringUnique identifier for the componentMust be unique throughout the page
classStringComponent's style classDefined in the corresponding CSS
styleStringInline style for the componentDynamically set inline styles
hiddenBooleanWhether the component is visibleAll components are visible by default
data-*AnyCustom data attributes for the componentSent to event handlers when an event is triggered on the component
bind:*EventHandlerComponent eventsSee event descriptions for details

Special Properties

Nearly all components have their own specific attributes that can be used to modify their functionality or style. Please refer to the documentation for each component for details.

Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.