Progress Component
Category: DataThe PROGRESS component is a WebComponent implementation based on the Progress module. Compared to the original module, it offers simpler usage without initialization requirements, making it ideal for project integration. It supports multiple variants (bar, full-circle, semicircle, and large-arc designs), theme colors (including gradients), customizable dimensions, and accepts any numeric progress value (not limited to percentages).

Progress Component: Property and Method Usage Examples1 month ago Progress Component1 month ago Progress Library: Animation and Control Examples1 month ago Progress Library: Visual Style Examples1 month ago Progress Library1 month ago Result Component1 month ago Step Component: How to Use Data and Customize Styles1 month ago Step Component1 month ago
Basic Usage
Use the oc-progress
element to create a progress bar, typically initialized with the value
attribute.
- Output
- HTML
Appearance Types
Set the progress bar type using the type
attribute, supported values include: line
, circle
, semicircle
, and gapcircle
.
- Output
- HTML
Theme Colors
Set the theme color using the theme
attribute, supported values include: prim
, succ
, error
, warn
, info
, issue
, and text
.
- Output
- HTML
Attributes
This component encapsulates the built-in instance, and its attributes are consistent with the parameters of the built-in instance. You can click here to view all parameters.
Several important notes:
- All component attributes should be lowercase.
- Attribute values must be in string format.
- If an attribute value is an object, the surrounding
{
and}
symbols can be omitted. - For attribute names that are verb-object structures or composed of two words, use hyphens to separate them. For example:
- Module parameter
contType
(if exists) should be written ascont-type
in component attributes - Parameter
b4Init
should be written asb4-init
in attributes
- Module parameter
- All methods, events, and variables can be accessed through the built-in instance (typically via
this.ins
). - When data cannot be passed through component attributes (e.g., due to nested single/double quote issues), you can manipulate the built-in instance to achieve your goal. It's particularly recommended to implement event listeners through the built-in instance.
Common Methods
Common component methods:
set
: Set properties (takes key-value pairs or array)reset
: Reset properties (no params)clear
: Clear properties and values (no params)
Basic usage: CompElem.reset()
Common Events
Common component events:
connected
: Component connected (no params)disconnected
: Component disconnected (no params)adopted
: Component moved (no params)set
: Property set (receives value)cleared
: Property cleared (no params)reset
: Property reset (no params)
Basic usage: CompElem.on('connected',()=>{console.log('connected')})