name

name

  • component : <FullpageSection />

  • requird : false

  • type : string

풀페이지가 렌더링될 때 URL의 hash(#)와 일치하는 이름의 섹션으로 이동합니다.

'use client';

import { useState } from 'react';
import { FullpageContainer, FullpageSection } from '@shinyongjun/react-fullpage';
import '@shinyongjun/react-fullpage/css';

function ExampleComponent() {
  const [activeIndex, setActiveIndex] = useState<number>(0);

  return (
    <FullpageContainer
      activeIndex={activeIndex}
      setActiveIndex={setActiveIndex}
    >
      <FullpageSection name="first"> // localhost:3000#first
        <div>Section 1</div>
      </FullpageSection>
      <FullpageSection name="second"> // localhost:3000#second
        <div>Section 2</div>
      </FullpageSection>
      <FullpageSection name="third"> // localhost:3000#third
        <div>Section 3</div>
      </FullpageSection>
    </FullpageContainer>
  );
}

export default ExampleComponent;

Last updated