/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; import RNTesterText from '../../components/RNTesterText'; import React from 'react'; import {Platform, PlatformColor, StyleSheet, View} from 'react-native'; type Props = $ReadOnly<{ style: ViewStyleProp, testID?: string, children?: React.Node, }>; function GradientBox(props: Props): React.Node { return ( {props.children} ); } const styles = StyleSheet.create({ box: { width: 200, height: 100, justifyContent: 'center', alignItems: 'center', marginVertical: 10, }, text: { color: 'white', fontWeight: 'bold', }, }); exports.title = 'Linear Gradient'; exports.category = 'UI'; exports.description = 'Examples of linear gradients applied to views.'; exports.examples = [ { title: 'Basic Linear Gradient', description: 'Linear gradient from top to bottom', name: 'basic', render(): React.Node { return ( Linear Gradient ); }, }, { title: 'Linear Gradient with corner angle', description: 'Rectangular Linear gradient with corner angle', name: 'corner-angle', render(): React.Node { return ( ); }, }, { title: 'Multiple linear gradients', name: 'multiple', render(): React.Node { return ( ); }, }, { title: 'Diagonal Gradient', description: 'Linear gradient from top-left to bottom-right', name: 'diagonal', render(): React.Node { return ( ); }, }, { title: 'Gradient with angle', description: 'Linear gradient with angle', name: 'angle', render(): React.Node { return ( ); }, }, { title: 'Multiple Color Stops', name: 'color-stops', render(): React.Node { return ( ); }, }, { title: 'Linear gradient with object style syntax', name: 'object-style-syntax', render(): React.Node { return ( ); }, }, { title: 'Gradient with uniform border style', name: 'uniform-borders', render(): React.Node { return ( ); }, }, { title: 'Gradient with non-uniform border style', name: 'non-uniform-borders', render(): React.Node { return ( ); }, }, { title: 'Gradient with Platform colors', name: 'platform-colors', render(): React.Node { return ( ); }, }, { title: 'Transition hint', name: 'transition-hint', render(): React.Node { return ( ); }, }, { title: 'Gradient with px and % combination', name: 'px-and-percentage', render(): React.Node { return ( ); }, }, { title: 'Non-square multiple color stops', name: 'non-square-multiple-color-stops', render(): React.Node { return ( ); }, }, { title: 'Gradient with transparent color transition', name: 'transparent-color-transition', render(): React.Node { return ( ); }, }, ] as Array;