Update md docs of custom components

This commit is contained in:
Insality
2022-03-12 11:54:45 +02:00
parent 102d8ca579
commit 9c2b442c50
6 changed files with 150 additions and 72 deletions

View File

@@ -37,7 +37,7 @@ local my_style = require("my.amazing.style")
local function init(self)
self.druid = druid.new(self)
self.button = self.druid:new_button(self, "node")
self.button = self.druid:new_button("node", function() end)
-- Setup custom style for specific component
self.button:set_style(my_style)
end
@@ -50,10 +50,10 @@ The most components have their styles. You can explore it on [Druid API](https:/
To create you style, create lua module, what return <_component_name_, _component_style_> table
Example: [default druid style](https://github.com/Insality/druid/blob/develop/druid/styles/default/style.lua)
Example: [default druid style](styles/default/style.lua)
Override all fields you want and set your style with one of next ways:
- Set your style as global via `druid.set_default_style`
- Set style for concrete druid instance via `druid = druid.new(self, style)`
- Set style for concrete instance via `component:set_style(style)`
- Set style for concrete instance via `component:set_style(style)`