Components
Component
s are the basic graphical building blocks of Vico.
Types
There are several built-in Component
s. These cover most use cases.
TextComponent
TextComponent
draws text. It supports font customization, line breaks, text rotation, backgrounds, and more.
- Compose
- Views
rememberTextComponent(...)
TextComponent(...)
ShapeComponent
ShapeComponent
s draw Shape
s, for which you can define a color, a stroke, and more.
- Compose
- Views
rememberShapeComponent(...)
ShapeComponent(...)
LineComponent
LineComponent
s, which are a type of ShapeComponent
, draw horizontal and vertical lines.
- Compose
- Views
rememberLineComponent(...)
LineComponent(...)
LayeredComponent
A LayeredComponent
s draws two Component
s on top of each other and lets you specify their spacing.
- Compose
- Views
rememberLayeredComponent(...)
LayeredComponent(...)
Shape
Most Component
s accept Shape
s, directly or indirectly. Use the following APIs to create instances:
- Compose
- Views
CorneredShape.Pill
CorneredShape.cut
(dp-based)CorneredShape.cut
(percentage-based)CorneredShape.rounded
(dp-based)CorneredShape.rounded
(percentage-based)CorneredShape
Shape.Rectangle
dashedShape
markerCorneredShape
DynamicShader
DynamicShader
s, which are accepted by selected APIs, let you create complex fills. Use the following APIs to create instances:
- Compose
- Views