There are 4 levels of buttons, form primary to quaternary:
[ R10.Button.primary []
{ label =
row [ spacing 15, centerX ]
[ R10.Paragraph.normal [] [ text "Primary button" ]
, R10.Svg.Icons.cart_f [] (R10.Color.Svg.fontButtonPrimary theme) 18
]
, libu = R10.Libu.Li "https://r10.netlify.app"
, theme = theme
}
, R10.Button.secondary []
{ label = R10.Paragraph.normal [] [ text "Secondary button" ]
, libu = R10.Libu.Li "https://r10.netlify.app"
, theme = theme
}
, R10.Button.tertiary []
{ label =
R10.Paragraph.normal []
[ text "Tertiary "
, el (R10.Link.attrs theme) <| text "button"
]
, libu = R10.Libu.Li "https://r10.netlify.app"
, theme = theme
}
, row [ width fill ]
[ R10.Button.quaternary [ moveLeft 13 ]
{ label = R10.Paragraph.normal [] [ text "Quaternary button" ]
, libu = R10.Libu.Li "https://r10.netlify.app"
, theme = theme
}
, R10.Button.quaternary [ alignRight, moveRight 13 ]
{ label = R10.Paragraph.normal [] [ text "Quaternary button" ]
, libu = R10.Libu.Li "https://r10.netlify.app"
, theme = theme
}
]
]
[ el [ R10.FontSize.xxlarge ] <| text "Font size: XX Large"
, el [ R10.FontSize.xlarge ] <| text "Font size: X Large"
, el [ R10.FontSize.large ] <| text "Font size: Large"
, el [ R10.FontSize.normal ] <| text "Font size: Normal"
, el [ R10.FontSize.small ] <| text "Font size: Small"
, el [ R10.FontSize.xsmall ] <| text "Font size: X Small"
, el [ R10.FontSize.xxsmall ] <| text "Font size: XX Small"
]
Forms have two different styles: Outlined and Filled:
Forms are defined by two things: Configuration and State. This is an example of configuration:
[ R10.Form.entity.field
{ id = "userId"
, idDom = Nothing
, type_ = R10.FormTypes.inputField.textUsername
, label = "User ID"
, helperText = Nothing
, requiredLabel = Just "Required"
, validationSpecs =
Just
{ showPassedValidationMessages = False
, hidePassedValidationStyle = True
, validationIcon = R10.FormTypes.NoIcon
, validation =
R10.Form.validation.allOf
[ R10.Form.validation.required
, R10.Form.validation.minLength 6
, R10.Form.validation.maxLength 128
, R10.Form.validation.withMsg
{ ok = "INVALID_FORMAT_INVALID_CHARACTERS"
, err = "INVALID_FORMAT_INVALID_CHARACTERS"
}
(R10.Form.validation.regex "^((?!(/|\\))[\x21-\x7F])+$")
]
}
}
]
To translate some text:
R10.I18n.t language R10.Translations.signInHeader
Where signInHeader
is defined as
signInHeader : Translations
signInHeader =
{ key = "signInHeader"
, en_us = "Sign in to your Rakuten account"
, zh_tw = "會員登入"
, ja_jp = "楽天会員 ログイン"
...
}
R10.Okaimonopanda.view
{ mouse = mouse
, screen = windowSize
}
Material Design Colors
Overview Colors
System Colors
Palette
UI.Theme.Theme`contains two values:
UI.Theme.Theme
is generated from flags using UI.Theme.fromFlags