import React, { useState } from 'react'; import { View, Text, StyleSheet, ScrollView } from 'react-native'; import { useUx4gTheme } from '../theme/Ux4gThemeContext'; import { UX4GColors } from '../foundation/colors'; import { Ux4gSlider, Ux4gRangeSlider, Ux4gRangeValues } from '../components/slider/Slider'; export const SliderShowcase: React.FC = () => { const theme = useUx4gTheme(); // Basic slider state const [basicValue, setBasicValue] = useState(50); const [disabledValue] = useState(40); // Sizes state const [smallValue, setSmallValue] = useState(30); const [mediumValue, setMediumValue] = useState(60); // Steps state const [stepsValue, setStepsValue] = useState(50); // Caption variants state const [helperValue, setHelperValue] = useState(70); const [errorValue, setErrorValue] = useState(20); const [warningValue, setWarningValue] = useState(85); const [successValue, setSuccessValue] = useState(95); // Input fields state const [inputFieldValue, setInputFieldValue] = useState(65); // Value labels state const [valueLabelsValue, setValueLabelsValue] = useState(45); // Marks and values state const [marksValue, setMarksValue] = useState(50); // Value indicator state const [indicatorValue, setIndicatorValue] = useState(35); // Range slider state const [range, setRange] = useState({ start: 20, end: 80 }); const [steppedRange, setSteppedRange] = useState({ start: 20, end: 60 }); return ( Ux4gSlider (`Ux4gSliderProps`) Complete React Native port of Flutter `slider.dart`, matching all props, visual behavior, and features including caption variants, marks, input fields, and value labels. {/* 1. Basic Sliders & States */} 1. Basic Sliders & States {/* 2. Sizes */} 2. Sizes (`s`/`small`, `m`/`medium`) {/* 3. Steps (Divisions) */} 3. Steps (Divisions) {/* 4. Caption Variants */} 4. Caption Variants (`helper`, `error`, `warning`, `success`) {/* 5. Marks and Values */} 5. Marks and Values (`showMarksAndValues`) `${val}°C`} /> {/* 6. Value Labels */} 6. Value Labels (`showValueLabels`) {/* 7. Input Fields */} 7. Input Fields (`showInputFields`) {/* 8. Combined Features */} 8. Combined Features `${val}%`} /> {/* 9. Value Indicator */} 9. Value Indicator (`showIndicator`) `${val}%`} /> {/* 10. Range Slider */} 10. Range Slider (`Ux4gRangeSlider`) ); }; const styles = StyleSheet.create({ container: { flex: 1, }, contentContainer: { padding: 16, paddingBottom: 40, }, header: { paddingBottom: 16, marginBottom: 20, borderBottomWidth: 1, }, title: { fontSize: 24, fontWeight: '700', marginBottom: 6, }, subtitle: { fontSize: 14, lineHeight: 20, }, section: { marginBottom: 24, }, sectionTitle: { fontSize: 18, fontWeight: '700', marginBottom: 12, }, card: { borderWidth: 1, borderRadius: 12, padding: 16, }, spacer: { height: 24, }, });