rio icon indicating copy to clipboard operation
rio copied to clipboard

Add `anchor` Attribute to `rio.Slider` Component

Open Sn3llius opened this issue 9 months ago • 0 comments

It would be beneficial to enhance the rio.Slider component by introducing an additional attribute called anchor?. This attribute will accept a Literal type with values "left" or "right", defaulting to "left". This feature will make the rio.Slider more versatile and allow developers to specify the anchor position of the slider.

Benefits:

  • Increased versatility of the rio.Slider component.
  • Better alignment control in various UI layouts.
  • Improved developer experience by providing more customization options.

Proposed API:

class Slider(FundamentalComponent):
    def __init__(self, ..., anchor: Literal["left", "right"] = "left"):

rio.Slider(..., anchor = "left") or rio.Slider(...): image

rio.Slider(anchor = "right"): image

Additional Context:

  • Ensure the default behavior remains unchanged to maintain backward compatibility.
  • Update relevant documentation to reflect the new attribute and its usage.

Sn3llius avatar Jun 03 '24 14:06 Sn3llius