[!WARNING]
This library is still in experimental mode. Expect API and UI breaking changes to happen without prior announcement.
Rettangoli is a UI library with following characteristics
- it uses flexbox
- implemented in web components
- designed to be used for UI editors such as rettangoli-editor
Component |
Component |
Description |
<rtgl-view> |
View |
Building block to build layouts |
<rtgl-button> |
Button |
Buttons |
<rtgl-text> |
Text |
Text |
<rtgl-image> |
Image |
Image |
<rtgl-svg> |
SVG |
SVG |
<rtgl-form> |
Form |
Forms |
The rtgl-view
component offers a variety of attributes for extensive customization. Below are detailed tables for each attribute category.
Attribute |
Meaning |
Values |
w |
Width |
custom |
h |
Height |
custom |
wh |
Width and Height |
custom |
d |
Direction |
h , v
|
ah |
Align Horizontal |
s , c , e
|
av |
Align Vertical |
s , c , e
|
as |
Align Self |
sch , s , c , e
|
f |
Flex |
1 , 0
|
fw |
Flex Wrap |
w |
g |
Flex Gap |
xs , s , m , l , xl
|
gh |
Flex Gap Horizontal |
xs , s , m , l , xl
|
gv |
Flex Gap Vertical |
xs , s , m , l , xl
|
m |
Margin |
xs , s , m , l , xl
|
mh |
Margin Horizontal |
xs , s , m , l , xl
|
mv |
Margin Vertical |
xs , s , m , l , xl
|
mt |
Margin Top |
xs , s , m , l , xl
|
mr |
Margin Right |
xs , s , m , l , xl
|
mb |
Margin Bottom |
xs , s , m , l , xl
|
ml |
Margin Left |
xs , s , m , l , xl
|
p |
Padding |
xs , s , m , l , xl
|
ph |
Padding Horizontal |
xs , s , m , l , xl
|
pv |
Padding Vertical |
xs , s , m , l , xl
|
pt |
Padding Top |
xs , s , m , l , xl
|
pr |
Padding Right |
xs , s , m , l , xl
|
pb |
Padding Bottom |
xs , s , m , l , xl
|
pl |
Padding Left |
xs , s , m , l , xl
|
bgc |
Background Color |
p , pc , s , sc , e , ec , su , sucl , suc , such
|
h-bgc |
Hover Background Color |
p , pc , s , sc , e , ec , su , sucl , suc , such
|
br |
Border Radius |
xs , s , m , l , xl , f
|
bw |
Border Width |
xs , s , m , l , xl
|
bc |
Border Color |
p , pc , s , sc , e , ec , su , sucl , suc , such
|
h-cur |
Hover Cursor |
p |
Attribute |
Meaning |
Description |
w |
Width |
|
h |
Heigh |
|
wh |
Width and Height |
Will set both width and height |
Values can bet set to any number. Can postfix the unit, otherwise it will default to px
Sets width and height to 120px
<rtgl-view wh="120"></rtgl-view>
<rtgl-view wh="120px"></rtgl-view>
<rgtl-view w="120" h="120"></rtgl-view>
<rgtl-view w="120px" h="120px"></rtgl-view>
Can also use other units
<rtgl-view width="100vw" height="100vh"></rtgl-view>
Attribute |
Meaning |
Description |
d |
Direction |
Children items will be oredred horizotannly or vertically |
Value |
Meaning |
v |
Vertical |
h |
Horizontal |
Attribute |
Meaning |
Description |
ah |
Align Horizontal |
Horizontally align child items |
av |
Align Vertical |
Vertically align child items |
as |
Align Self |
How to align self |
Value |
Meaning |
Default |
|
none |
Yes |
s |
start |
|
c |
center |
|
e |
end |
|
Only available for Align Self
Value |
Meaning |
Default |
sch |
Stretch |
|
<rtgl-view ah="c"></rtgl-view>
<rtgl-view ah="e"></rtgl-view>
<rtgl-view av="c"></rtgl-view>
<rtgl-view av="e"></rtgl-view>
Attribute |
Meaning |
Description |
flex |
Flex |
Flex grow and shirink |
Value |
Meaning |
0 |
0 |
1 |
1 |
none |
none |
<rtgl-view flex="1"></rtgl-view>
<rtgl-view flex="2"></rtgl-view>
<rtgl-view flex="3"></rtgl-view>
Attribute |
Meaning |
Description |
fw |
Flex Wrap |
Flex wrap or no wrap |
<rtgl-view fw="w"></rtgl-view>
Attribute |
Meaning |
Description |
g |
Flex Gap |
Flex Gap both horizontal and vertical |
gh |
Flex Gap Horizontal |
Flex Gap Horizontal |
gv |
Flex Gap Vertical |
Flex Gap Vertical |
Value |
Meaning |
xs |
Extra small |
s |
Small |
m |
Medium |
l |
Large |
xl |
Extra large |
<rtgl-view g="m"></rtgl-view>
<rtgl-view gh="m" gv="m"></rtgl-view>
Attribute |
Meaning |
Description |
m |
Margin |
Sets margin in all 4 directions |
mh |
Margin Horizontal |
Sets left and right margin |
mv |
Margin Vertical |
Sets top and bottom margin |
mt |
Margin Top |
|
ml |
Margin Left |
|
mb |
Margin Bottom |
|
mr |
Margin Right |
|
Value |
Meaning |
xs |
Extra small |
s |
Small |
m |
Medium |
l |
Large |
xl |
Extra large |
<rtgl-view m="m"></rtgl-view>
<rtgl-view mh="m" mv="m"></rtgl-view>
<rtgl-view mt="m" mr="m" mb="m" ml="m"></rtgl-view>
Attribute |
Meaning |
Description |
p |
Padding |
Sets padding in all 4 directions |
ph |
Padding Horizontal |
Sets left and right padding |
pv |
Padding Vertical |
Sets top and bottom padding |
pt |
Padding Top |
|
pl |
Padding Left |
|
pb |
Padding Bottom |
|
pr |
Padding Right |
|
Value |
Meaning |
xs |
Extra small |
s |
Small |
m |
Medium |
l |
Large |
xl |
Extra large |
<rtgl-view p="m"></rtgl-view>
<rtgl-view ph="m" pv="m"></rtgl-view>
<rtgl-view pt="m" pr="m" pb="m" pl="m"></rtgl-view>
Attribute |
Meaning |
Description |
bgc |
Background Color |
Background Color |
h-bgc |
Hover Background Color |
Background Color |
Value |
Meaning |
p |
primary |
pc |
primary-container |
s |
secondary |
sc |
secondary container |
e |
error |
ec |
error-container |
su |
surface |
sucl |
surface container low |
suc |
surface container |
such |
suface container high |
TODO
Attribute |
Meaning |
Description |
br |
Border Radius |
Border Radius |
Value |
Meaning |
xs |
Extra small |
s |
Small |
m |
Medium |
l |
Large |
xl |
Extra large |
f |
Full |
TODO
Attribute |
Meaning |
Description |
bw |
Border Width |
Border Width |
Value |
Meaning |
xs |
Extra small |
s |
Small |
m |
Medium |
l |
Large |
xl |
Extra large |
TODO
Attribute |
Meaning |
Description |
bc |
Border Color |
Border Color |
Value |
Meaning |
p |
primary |
pc |
primary-container |
s |
secondary |
sc |
secondary container |
e |
error |
ec |
error-container |
s |
surface |
scl |
surface container low |
sc |
surface container |
sch |
suface container high |
TODO
Attribute |
Meaning |
Description |
h-cur |
Hover Cursor |
Hover Cursor |
TODO
The rtgl-button
provides basic styling for buttons
Attribute |
Meaning |
Values |
t |
Type |
p , pl , ps , s , sl , ss , e , el
|
f |
Flex |
1 , 0
|
as |
Align Self |
sch , s , c , e
|
m |
Margin |
xs , s , m , l , xl
|
mh |
Margin Horizontal |
xs , s , m , l , xl
|
mv |
Margin Vertical |
xs , s , m , l , xl
|
mt |
Margin Top |
xs , s , m , l , xl
|
mr |
Margin Right |
xs , s , m , l , xl
|
mb |
Margin Bottom |
xs , s , m , l , xl
|
ml |
Margin Left |
xs , s , m , l , xl
|
Attribute |
Meaning |
Description |
t |
Type |
Provides type combinations for different sizes and color styles |
Value |
Meaning |
p |
Primary |
pl |
Primary Large |
ps |
Primary Small |
s |
Secondary |
sl |
Secondary Large |
ss |
Secondary Small |
e |
Error |
el |
Error Large |
es |
Error Small |
The rtgl-text
provides text in standard sizes and colors
Attribute |
Meaning |
Values |
s |
Size |
dm , hm , tl , tm , ts , bl , bm , bs , ll , lm
|
c |
Color |
on-p , on-pc , on-s , on-sc , on-su , on-suv , i-on-s , on-e , on-ec
|
f |
Flex |
1 , 0
|
as |
Align Self |
sch , s , c , e
|
m |
Margin |
xs , s , m , l , xl
|
mh |
Margin Horizontal |
xs , s , m , l , xl
|
mv |
Margin Vertical |
xs , s , m , l , xl
|
mt |
Margin Top |
xs , s , m , l , xl
|
mr |
Margin Right |
xs , s , m , l , xl
|
mb |
Margin Bottom |
xs , s , m , l , xl
|
ml |
Margin Left |
xs , s , m , l , xl
|
h-cur |
Hover Cursor |
p |
Attribute |
Meaning |
Description |
s |
Size |
Text sizes |
Value |
Meaning |
dm |
Display Medium |
hm |
Headline Medium |
tl |
Title Large |
tm |
Title Medium |
ts |
Title Small |
bl |
Body Large |
bm |
Body Medium |
bs |
Body Small |
ll |
Label Large |
lm |
Label Medium |
TODO
Attribute |
Meaning |
Description |
c |
Color |
Text color |
Value |
Meaning |
on-p |
On Primary |
on-pc |
On Primary Container |
on-s |
On Secondary |
on-sc |
On Secondary Container |
on-su |
On Surface |
on-suv |
on Surface Variant |
i-on-s |
Inverse on surface |
on-e |
On Error |
on-ec |
On Error Container |
TODO
Displays images
Attribute |
Meaning |
Values |
w |
Width |
custom |
h |
Height |
custom |
wh |
Width and Height |
custom |
src |
Source |
custom |
of |
Object Fit |
cov , con
|
f |
Flex |
1 , 0
|
as |
Align Self |
sch , s , c , e
|
m |
Margin |
xs , s , m , l , xl
|
mh |
Margin Horizontal |
xs , s , m , l , xl
|
mv |
Margin Vertical |
xs , s , m , l , xl
|
mt |
Margin Top |
xs , s , m , l , xl
|
mr |
Margin Right |
xs , s , m , l , xl
|
mb |
Margin Bottom |
xs , s , m , l , xl
|
ml |
Margin Left |
xs , s , m , l , xl
|
h-cur |
Hover Cursor |
p |
br |
Border Radius |
xs , s , m , l , xl , f
|
Attribute |
Meaning |
Description |
src |
Source |
Same as standard <img src="">
|
Should be a url to a remote or local image
TODO
Attribute |
Meaning |
Description |
of |
Object Fit |
|
Value |
Meaning |
cov |
Cover |
con |
Contain |
TODO
Attribute |
Meaning |
Values |
w |
Width |
custom |
h |
Height |
custom |
wh |
Width and Height |
custom |
svg |
SVG |
custom |
f |
Flex |
1 , 0
|
m |
Margin |
xs , s , m , l , xl
|
as |
Align Self |
sch , s , c , e
|
mh |
Margin Horizontal |
xs , s , m , l , xl
|
mv |
Margin Vertical |
xs , s , m , l , xl
|
mt |
Margin Top |
xs , s , m , l , xl
|
mr |
Margin Right |
xs , s , m , l , xl
|
mb |
Margin Bottom |
xs , s , m , l , xl
|
ml |
Margin Left |
xs , s , m , l , xl
|
h-cur |
Hover Cursor |
p |
Attribute |
Meaning |
Description |
svg |
SVG |
|
Name of the svg
All names must be registered with global window variable:
window.rtglSvgs = {
'svgName1': '<svg>...</svg>',
'svgName2': '<svg>...</svg>'
}
<rtgl-svg svg="svgName1"></rtgl-svg>
TODO