@@ -55,7 +55,7 @@ Study the bslib implementation to understand:
55555 . ** Dependencies** : What other components or utilities it relies on
5656
5757** Key patterns to note:**
58- - How does the component register its input binding ?
58+ - Is the component an input binding? If so, how does the binding register (typically via a CSS class) ?
5959- What markup structure does it generate on the server side?
6060- How does the component integrate with Bootstrap classes?
6161- How are configuration options passed from R to JavaScript -- data attributes, embedded JSON, etc.?
@@ -87,7 +87,7 @@ Create a new file in `shiny/ui/` for the component implementation.
8787
8888** Common translations:**
8989- R ` tags$div() ` → Python ` div() ` or ` tags.div() `
90- - R ` !!!args ` (splicing) → Python ` **kwargs `
90+ - R ` !!!args ` (splicing) → Python ` *args ` + ` * *kwargs`
9191- R ` NULL ` → Python ` None `
9292- R lists → Python dicts or lists as appropriate
9393- R ` paste0() ` → Python f-strings or ` .format() `
@@ -517,14 +517,14 @@ The component should work with all Bootstrap themes. The `make upgrade-html-deps
517517Python style guide preferences:
518518- Use ` snake_case ` for parameter names
519519- Match bslib's parameter names when possible
520- - Use ` Optional[T] ` for parameters that can be ` None `
520+ - Use ` Optional[T] ` for user-facing parameters that can be ` None `
521521- Use ` Literal ` rather than ` Enum ` for parameters with specific allowed values
522522
523523### Working with htmltools
524524
525525Key patterns:
526- - ` Tag ` objects are immutable by default, use ` copy.copy() ` if you need to modify
527- - Use ` tagAppendAttributes ()` to add classes/ attributes
526+ - ` Tag ` objects are mutable by default, use ` copy.copy() ` if you need to modify
527+ - Use ` .add_class ()` , ` .add_style() ` , ` .attrs ` to add CSS classes, styles, and HTML attributes
528528- Use ` css() ` helper for inline styles
529529- Tag children can be strings, Tags, TagLists, or None
530530
0 commit comments