react-native-ruler-picker icon indicating copy to clipboard operation
react-native-ruler-picker copied to clipboard

feat: add showValueText prop to control value text display

Open Lanioque opened this issue 6 months ago • 0 comments

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) <RulerPicker min={0} max={100} showValueText={true} />

// Hide value text <RulerPicker min={0} max={100} showValueText={false} /> \\

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.

Lanioque avatar Oct 17 '25 17:10 Lanioque