diff --git a/docs/custom-components.md b/docs/custom-components.md
index 0f327f5a3..f0e4a7dda 100644
--- a/docs/custom-components.md
+++ b/docs/custom-components.md
@@ -22,8 +22,11 @@ If you want to customize the default UI, check the [styling](styling.md) docs.
### Example with styled-components
-```jsx
-import Joyride, { BeaconRenderProps, TooltipRenderProps } from 'react-joyride';
+```tsx
+import { forwardRef } from 'react';
+import Joyride, { BeaconRenderProps } from 'react-joyride';
+import { keyframes } from '@emotion/react';
+import styled from '@emotion/styled';
const pulse = keyframes`
0% {
@@ -45,15 +48,20 @@ const Beacon = styled.span`
width: 3rem;
`;
-export () => (
-
- } for TS
- ...
- />
-
-);
+const BeaconComponent = forwardRef((props, ref) => {
+ return ;
+});
+
+export function App() {
+ return (
+
+
+
+ );
+}
```
## tooltipComponent
@@ -80,47 +88,51 @@ export () => (
**tooltipProps** {object}: The root element props \(including `ref`\)
-### Example with styled-components
-
-```jsx
-const Tooltip = ({
- continuous,
- index,
- step,
- backProps,
- closeProps,
- primaryProps,
- tooltipProps,
-}) => (
-
- {step.title && {step.title}}
- {step.content}
-
- {index > 0 && (
-
- )}
- {continuous && (
-
- )}
- {!continuous && (
-
- )}
-
-
-);
-
-export () => (
-
-
-
-);
+### Example with css classes
+
+```tsx
+import Joyride, { TooltipRenderProps } from 'react-joyride';
+
+function CustomTooltip(props: TooltipRenderProps) {
+ const { backProps, closeProps, continuous, index, primaryProps, skipProps, step, tooltipProps } =
+ props;
+
+ return (
+
+
+ {step.title &&
{step.title}
}
+
{step.content}
+
+
+
+ {index > 0 && (
+
+ )}
+ {continuous && (
+
+ )}
+
+
+
+ );
+}
+
+export function App() {
+ return (
+
+
+
+ );
+}
```