prop-types#node JavaScript Examples

The following examples show how to use prop-types#node. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SlideAnimation.js    From wix-style-react with MIT License 6 votes vote down vote up
SlideAnimation.propTypes = {
  isVisible: bool.isRequired,
  direction: oneOf([SlideDirection.in, SlideDirection.out]),
  animateAppear: bool,
  animateEnter: bool,
  animateLeave: bool,
  children: node,
  onEnter: func,
  onEntered: func,
  onExit: func,
  onExited: func,
};
Example #2
Source File: Card.js    From wix-style-react with MIT License 6 votes vote down vote up
Card.propTypes = {
  /** any node to render inside card */
  children: node,
  /** any node that controls card e.g. a close button */
  controls: node,
  /** makes the card stretch to max height in a container */
  stretchVertically: bool,
  /** makes the card's overflow content to be hidden */
  hideOverflow: bool,
  /** additional css classes */
  className: string,
  dataHook: string,
};
Example #3
Source File: FillPreview.js    From wix-style-react with MIT License 6 votes vote down vote up
FillPreview.propTypes = {
  /** render as some other component or DOM tag */
  as: oneOfType([func, object, string]),

  /** control focusability */
  tabIndex: number,

  /** Color, gradient, image url or svg to be rendered as a preview content */
  fill: oneOfType([string, node]),

  /** Outlines the border when set to true */
  selected: bool,

  /** Pass your handler for click event */
  onClick: func,

  /** Puts the component into a disabled state */
  disabled: bool,

  /** Control elements aspect ratio value:  */
  aspectRatio: oneOfType([string, number]),
};
Example #4
Source File: MultiSelectComposite.js    From wix-style-react with MIT License 6 votes vote down vote up
MultiSelectComposite.propTypes = {
  children: Composite.children(
    Composite.optional(Label),
    Composite.once(MultiSelect),
  ),
  required: bool,
  appendToParent: bool,
  info: node,
  tooltip: node,
};
Example #5
Source File: VerticalTabs.js    From wix-style-react with MIT License 6 votes vote down vote up
VerticalTabs.propTypes = {
  /** Text Size (small, medium) */
  size: oneOf(['small', 'medium']),

  /** Current selected tab id */
  activeTabId: number,

  /** Callback function called on tab selection change with the following parameters<code>(id)</code> */
  onChange: func,

  /** Child nodes of this component must be of type <code><VerticalTabs.TabsGroup></code> or <code><VerticalTabs.Footer></code>*/
  children: arrayOf(node),

  /** Data attribute for testing purposes */
  dataHook: string,
};
Example #6
Source File: SingleComponentStacked.js    From wix-style-react with MIT License 6 votes vote down vote up
SingleComponentStacked.propTypes = {
  /** storybook name */
  name: oneOfType([string, object]),
  /** names of the used components */
  componentsNames: array,
  /** any node to render inside */
  children: node,
  /** size of the children column. Can be one of "singleComponentSizes" constant */
  size: number,
};
Example #7
Source File: Poppable.props.js    From webrix with Apache License 2.0 6 votes vote down vote up
propTypes = {
    container: oneOfType([
        func,
        shape({current: oneOfType([instanceOf(Element), instanceOf(_window.constructor)])}),
    ]),
    reference: oneOfType([
        func,
        instanceOf(DOMRect),
        shape({current: instanceOf(Element)}),
    ]),
    placements: func,
    placement: shape({
        top: number,
        left: number,
    }),
    overflow: func,
    onPlacement: func,
    default: number,
    children: node,
}
Example #8
Source File: Scrollable.props.js    From webrix with Apache License 2.0 6 votes vote down vote up
propTypes = {
    style: shape({}),
    onScroll: func,
    onUpdate: func,
    scrollOnDOMChange: bool,
    children: node,
    element: node,
    cssVarsOnTracks: bool, // temporary workaround for Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1266517
}
Example #9
Source File: Puppeteer.props.js    From webrix with Apache License 2.0 6 votes vote down vote up
propTypes = {
    puppeteer: {
        children: node,
        props: shape({}),
        namespace: string,
    },
    break: {
        children: node,
        props: arrayOf(string),
        namespace: string,
    },
}
Example #10
Source File: process.js    From basic-redis-chat-demo-go with MIT License 6 votes vote down vote up
export function processChannelMessage(inputMessage) {
    if(inputMessage == null) {
        inputMessage = node(nodeIdInputMessage);
    }
    console.log('channelMessage', inputMessage)
    let process = new Promise((resolve, reject) => webSocketSend(DataChannelMessage(selectedRecipientUUID, inputMessage)));
    process.then(() => {});
    process.catch((err) => console.log(err));
    return false;
}
Example #11
Source File: MenuItem.js    From react-menu with MIT License 6 votes vote down vote up
process.env.NODE_ENV !== "production" ? MenuItem.propTypes = /*#__PURE__*/_extends({}, /*#__PURE__*/stylePropTypes(), {
  value: any,
  href: string,
  type: /*#__PURE__*/oneOf(['checkbox', 'radio']),
  checked: bool,
  disabled: bool,
  children: /*#__PURE__*/oneOfType([node, func]),
  onClick: func
}) : void 0;
Example #12
Source File: MenuItem.js    From react-menu with MIT License 6 votes vote down vote up
MenuItem.propTypes = {
  ...stylePropTypes(),
  value: any,
  href: string,
  type: oneOf(['checkbox', 'radio']),
  checked: bool,
  disabled: bool,
  children: oneOfType([node, func]),
  onClick: func
};
Example #13
Source File: SubMenu.js    From react-menu with MIT License 6 votes vote down vote up
SubMenu.propTypes = {
  ...menuPropTypes,
  ...uncontrolledMenuPropTypes,
  disabled: bool,
  openTrigger: oneOf(['none', 'clickOnly']),
  label: oneOfType([node, func]),
  itemProps: shape({
    ...stylePropTypes()
  })
};
Example #14
Source File: types.js    From react-native-neomorph-shadows with MIT License 6 votes vote down vote up
InnerShadowType = {
  ...ViewPropTypes,
  children: node,
  style: shape({
    ...ViewPropTypes.style,
    width: number.isRequired,
    height: number.isRequired,
  }),
}
Example #15
Source File: index.js    From juggernaut-desktop with MIT License 5 votes vote down vote up
ctaType = shape({
  type: oneOf(['button', 'icon']).isRequired,
  action: func.isRequired,
  label: string,
  icon: oneOfType([string, node]),
  tooltip: string
})
Example #16
Source File: InputAreaWithLabelComposite.js    From wix-style-react with MIT License 5 votes vote down vote up
InputAreaWithLabelComposite.propTypes = {
  children: any,
  required: bool,
  appendToParent: bool,
  info: node,
  tooltip: node,
};
Example #17
Source File: Link.js    From wix-style-react with MIT License 5 votes vote down vote up
Link.propTypes = {
  children: node.isRequired,
  isActive: bool,
};
Example #18
Source File: FieldLabelAttributes.js    From wix-style-react with MIT License 5 votes vote down vote up
FieldLabelAttributes.propTypes = {
  required: bool,
  info: node,
  appendToParent: bool,
  tooltip: node,
};
Example #19
Source File: ToggleButton.js    From wix-style-react with MIT License 5 votes vote down vote up
ToggleButton.propTypes = {
  children: node,
  prefixIcon: node,
  value: string,
  selected: bool,
  disabled: bool,
};
Example #20
Source File: Swatches.js    From wix-style-react with MIT License 5 votes vote down vote up
Swatches.propTypes = {
  /** Array of colors to be shown as swatches */
  colors: array,

  /** Selected color */
  selected: string,

  /** Data-hook for testing */
  dataHook: string,

  /** Callback function when user clicks on a swatch. Returns color HEX string representation. */
  onClick: func,

  /** Size of swatches */
  size: oneOf(['small', 'medium']),

  /** If true shows no color option */
  showClear: bool,

  /** optional message to display in tooltip when showClear is true */
  showClearMessage: node,

  /** Callback function when user clicks on Add button and selects a color to be added. Returns color HEX string representation. */
  onAdd: func,

  /** Callback function when user changes color in Color Picker. Returns color HEX string representation. */
  onChange: func,

  /** Callback function when user closes Color Picker without picking color. */
  onCancel: func,

  /** If true shows add button which triggers colors picker*/
  showAddButton: bool,

  /** Text for add button tooltip*/
  addButtonMessage: string,

  /** Size of Plus icon inside add button */
  addButtonIconSize: oneOf(['small', 'medium']),

  /** Number of maximum columns. Default value is 6 */
  columns: number,

  /** Gap between swatches. Default value is 12 */
  gap: number,
};
Example #21
Source File: TableToolbar.js    From wix-style-react with MIT License 5 votes vote down vote up
Title.propTypes = {
  children: node,
  dataHook: string,
};
Example #22
Source File: TableToolbar.js    From wix-style-react with MIT License 5 votes vote down vote up
SelectedCount.propTypes = {
  children: node,
  dataHook: string,
};
Example #23
Source File: Footer.jsx    From Turnip-Calculator with MIT License 5 votes vote down vote up
Link.propTypes = {
  href: string,
  children: node,
};
Example #24
Source File: Providers.jsx    From Turnip-Calculator with MIT License 5 votes vote down vote up
Providers.propTypes = {
  children: node.isRequired,
};
Example #25
Source File: flex.js    From nextjs-material-ui-boilerplate with MIT License 5 votes vote down vote up
Flex.propTypes = {
  children: node.isRequired,
};
Example #26
Source File: Popover.js    From react-nice-dates with MIT License 5 votes vote down vote up
Popover.propTypes = {
  children: node,
  open: bool
}
Example #27
Source File: Ticket.js    From thekusuma with MIT License 5 votes vote down vote up
LayoutTicket.propTypes = {
  children: node.isRequired,
};
Example #28
Source File: index.js    From thekusuma with MIT License 5 votes vote down vote up
MainLayout.propTypes = {
  children: node.isRequired,
};
Example #29
Source File: Collapsible.props.js    From webrix with Apache License 2.0 5 votes vote down vote up
propTypes = {
    expanded: bool,
    onTransitionEnd: func,
    children: node.isRequired,
}