Skip to content

Conversation

@Lanioque
Copy link

Feature: Add showValueText Prop

This PR adds a new showValueText prop to the RulerPicker component that allows developers to control whether the value text display (number + unit) is shown above the ruler indicator.

What's New:

  • New prop: showValueText?: boolean (default: rue)
  • Backward compatible: Existing code continues to work unchanged
  • Conditional rendering: Value text is only rendered when showValueText is rue
  • Optimized performance: Text input updates are skipped when value text is hidden

Changes Made:

  1. Core Component: Added showValueText prop to RulerPickerProps interface
  2. Conditional Rendering: Value text display is now conditionally rendered
  3. Performance Optimization: Value callback only updates text input when needed
  4. Example App: Updated to demonstrate both with and without value text
  5. Documentation: Updated README with new prop documentation and usage examples

Usage Examples:

\\jsx
// Default behavior (shows value text)

// Hide value text

\\

Testing:

  • Backward compatibility maintained
  • TypeScript types updated
  • Example app demonstrates both modes
  • Documentation updated

This enhancement provides more flexibility for developers who want to use the ruler picker without the built-in value display, allowing them to implement their own custom value display logic.

- Add showValueText prop (default: true) to RulerPickerProps interface
- Conditionally render value text display based on showValueText prop
- Update value callback to only update text input when showValueText is true
- Adjust indicator positioning when value text is hidden
- Update example app to demonstrate both with and without value text
- Update README with new prop documentation and usage examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant